From 107d054ba954d05965f793f560468c6c453cc2a5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 3 Oct 2014 00:20:57 +0200 Subject: implement MarkAndSweep in cc instead of header Having it in the header exposes some implementation details, namely private methods and will cause problems for us if we ever want to change the actions. Git-Dch: Ignore --- apt-pkg/depcache.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'apt-pkg/depcache.cc') diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 16282df21..1332f3ee2 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1961,3 +1961,17 @@ bool pkgDepCache::Sweep() /*{{{*/ return true; } /*}}}*/ +// DepCache::MarkAndSweep /*{{{*/ +bool pkgDepCache::MarkAndSweep(InRootSetFunc &rootFunc) +{ + return MarkRequired(rootFunc) && Sweep(); +} +bool pkgDepCache::MarkAndSweep() +{ + std::auto_ptr f(GetRootSetFunc()); + if(f.get() != NULL) + return MarkAndSweep(*f.get()); + else + return false; +} + /*}}}*/ -- cgit v1.2.3