Skip to content

Commit

Permalink
Merge pull request ocaml#4882 from OCamlPro/faster-instlist
Browse files Browse the repository at this point in the history
Optimisation for partial installability queries
  • Loading branch information
kit-ty-kate authored and rjbou committed Apr 22, 2022
1 parent 1127a59 commit 2e0aad6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ New option/command/subcommand are prefixed with ◈.
*

## List
*
* Some optimisations to 'opam list --installable' queries combined with other filters [@altgr]

## Show
*
Expand Down
4 changes: 2 additions & 2 deletions src/client/opamCommands.ml
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,6 @@ let list ?(force_search=false) cli =
in
let filter =
OpamFormula.ands [
state_selector;
join
(pattern_selector ::
(if no_switch then Empty else
Expand All @@ -633,7 +632,8 @@ let list ?(force_search=false) cli =
OpamStd.Option.Op.
((owns_file >>| fun f -> Atom (OpamListCommand.Owns_file f)) +!
Empty) ::
List.map (fun x -> Atom x) selection)
List.map (fun x -> Atom x) selection);
state_selector;
]
in
OpamGlobalState.with_ `Lock_none @@ fun gt ->
Expand Down
3 changes: 2 additions & 1 deletion src/client/opamListCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,9 @@ let apply_selector ~base st = function
| Compiler -> st.compiler_packages
| Available -> Lazy.force st.available_packages
| Installable ->
OpamSolver.installable
OpamSolver.installable_subset
(OpamSwitchState.universe st ~requested:OpamPackage.Name.Set.empty Query)
base
| Pinned -> OpamPinned.packages st
| (Required_by ({recursive=true; _} as tog, atoms)
| Depends_on ({recursive=true; _} as tog, atoms)) as direction ->
Expand Down

0 comments on commit 2e0aad6

Please sign in to comment.