From c3638240da5f1b56a807cdf802495704bd395cc2 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Thu, 18 Sep 2014 16:58:54 +0200 Subject: [PATCH] rpm: reuse the same iteration set When resolving the requirements of a package, use the same set with the results, instead of creating a new set and merging it with the results set. --- src/rpm.ml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rpm.ml b/src/rpm.ml index 3a75ea0..4c2156a 100644 --- a/src/rpm.ml +++ b/src/rpm.ml @@ -212,13 +212,12 @@ let rpm_get_all_requires pkgs = let provides = try Hashtbl.find rpm_providers x with Not_found -> rpm_pkg_whatprovides (get_rpm ()) x in - let newset = Array.fold_left ( + Array.fold_left ( fun newset p -> match rpm_package_of_string p with | None -> newset | Some x -> StringSet.add p newset - ) StringSet.empty provides in - StringSet.union set newset + ) set provides with Not_found -> set ) StringSet.empty reqs in pkgs' -- 1.9.3