From 6dcae298f972eb20223838f0e1dc376c44bc9cc3 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 6 May 2016 16:46:51 +0200 Subject: edsp: use a limited scenario based on bool-array Its more space and runtime efficient to use a boolean set instead of a CacheSet-based implementation. Git-Dch: Ignore --- cmdline/apt-internal-solver.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index fa54657c0..12f4d6f93 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -88,7 +88,12 @@ int main(int argc,const char *argv[]) /*{{{*/ if (pkgset.empty() == true) EDSP::WriteScenario(CacheFile, output); else - EDSP::WriteLimitedScenario(CacheFile, output, pkgset); + { + std::vector pkgvec(CacheFile->Head().PackageCount, false); + for (auto const &p: pkgset) + pkgvec[p->ID] = true; + EDSP::WriteLimitedScenario(CacheFile, output, pkgvec); + } output.Close(); _error->DumpErrors(std::cerr); return 0; -- cgit v1.2.3