diff --git a/master_changes.md b/master_changes.md index a1f0c508c37..c5a3919e4c1 100644 --- a/master_changes.md +++ b/master_changes.md @@ -45,7 +45,9 @@ users) * ◈ New option `opam pin --current` to fix a package in its current state (avoiding pending reinstallations or removals from the repository) [#4973 @AltGr - fix #4970] ## List - * Some optimisations to 'opam list --installable' queries combined with other filters [@altgr] + * Some optimisations to 'opam list --installable' queries combined with other filters [#4882 @altgr - fix #4311] + * Improve performance of some opam list combination (e.g. --available --installable) [#4999 @kit-ty-kate] + * Improve performance of opam list --conflicts-with when combined with other filters [#4999 @kit-ty-kate] ## Show * Add `depexts` to default printer [#4898 @rjbou] diff --git a/src/client/opamListCommand.ml b/src/client/opamListCommand.ml index d345afb30ea..d491d2bb585 100644 --- a/src/client/opamListCommand.ml +++ b/src/client/opamListCommand.ml @@ -243,7 +243,7 @@ let apply_selector ~base st = function base | Conflicts_with packages -> OpamSwitchState.conflicts_with st (OpamPackage.Set.of_list packages) - (Lazy.force st.available_packages) + base | Coinstallable_with (tog, packages) -> let universe = get_universe st tog in let set = OpamPackage.Set.of_list packages in @@ -370,11 +370,11 @@ let apply_selector ~base st = function let rec filter ~base st = function | Empty -> base - | Atom select -> apply_selector ~base st select + | Atom select -> base %% apply_selector ~base st select | Block b -> filter ~base st b | And (a, b) -> let base = filter ~base st a in - base %% filter ~base st b + filter ~base st b | Or (a, b) -> filter ~base st a ++ filter ~base st b type output_format =