The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix topological stable sort.

+14 -11
+14 -11
vendor/opam/ocamlgraph/src/topological.ml
··· 119 119 H.remove degree x; 120 120 Q.push x todo 121 121 in 122 + let add_vertex acc v = 123 + G.iter_succ 124 + (fun x-> 125 + try 126 + let d = H.find degree x in 127 + if d = 1 then push x else H.replace degree x (d-1) 128 + with Not_found -> 129 + (* [x] already visited *) 130 + ()) 131 + g v; 132 + f v acc in 122 133 let rec walk acc = 123 134 if Q.is_empty todo then 124 135 (* let's find any node of minimal degree *) ··· 129 140 | [] -> acc 130 141 | _ -> 131 142 let vl = find_top_cycle checker min in 132 - List.iter push vl; 143 + List.iter (H.remove degree) vl; 144 + let acc = List.fold_left add_vertex acc vl in 133 145 (* let v = choose_independent_vertex checker min in push v; *) 134 146 walk acc 135 147 else 136 148 let v = Q.pop todo in 137 - let acc = f v acc in 138 - G.iter_succ 139 - (fun x-> 140 - try 141 - let d = H.find degree x in 142 - if d = 1 then push x else H.replace degree x (d-1) 143 - with Not_found -> 144 - (* [x] already visited *) 145 - ()) 146 - g v; 149 + let acc = add_vertex acc v in 147 150 walk acc 148 151 in 149 152 G.iter_vertex