Skip to content

Commit

Permalink
refactor(pkg): reduce scope of some bindings (#11262)
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>
  • Loading branch information
rgrinberg authored Jan 2, 2025
1 parent 8a30fb1 commit 7e8d638
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/0install-solver/solver_core.ml
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,16 @@ module Make (Model : S.SOLVER_INPUT) = struct
(* For each (iface, source) we have a list of implementations. *)
let impl_cache = ImplCache.create () in
let conflict_classes = Conflict_classes.create sat in
let rec add_impls_to_cache role =
let+ clause, impls = make_impl_clause sat ~dummy_impl role in
( clause
, fun () ->
Fiber.sequential_iter impls ~f:(fun (impl_var, impl) ->
Conflict_classes.process conflict_classes impl_var impl;
Model.requires role impl
|> Fiber.sequential_iter ~f:(process_dep sat lookup_impl impl_var)) )
and lookup_impl key = ImplCache.lookup impl_cache add_impls_to_cache key in
let+ () =
let rec add_impls_to_cache role =
let+ clause, impls = make_impl_clause sat ~dummy_impl role in
( clause
, fun () ->
Fiber.sequential_iter impls ~f:(fun (impl_var, impl) ->
Conflict_classes.process conflict_classes impl_var impl;
Model.requires role impl
|> Fiber.sequential_iter ~f:(process_dep sat lookup_impl impl_var)) )
and lookup_impl key = ImplCache.lookup impl_cache add_impls_to_cache key in
(* This recursively builds the whole problem up. *)
lookup_impl root_req
>>| Candidates.vars
Expand Down

0 comments on commit 7e8d638

Please sign in to comment.