]> git.saurik.com Git - apt.git/commitdiff
implement MarkAndSweep in cc instead of header
authorDavid Kalnischkies <david@kalnischkies.de>
Thu, 2 Oct 2014 22:20:57 +0000 (00:20 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Thu, 2 Oct 2014 22:20:57 +0000 (00:20 +0200)
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
apt-pkg/depcache.h

index 16282df2135e358c9917139737527cffdd4f30d4..1332f3ee20ad16f0f6dd43e981d29c76ba966392 100644 (file)
@@ -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<InRootSetFunc> f(GetRootSetFunc());
+   if(f.get() != NULL)
+      return MarkAndSweep(*f.get());
+   else
+      return false;
+}
+                                                                       /*}}}*/
index f9a13dec51763fbaf2b0bbab915be7488eb3489c..5554e1a696d54c7c0364dff7540d3ffb910f0072 100644 (file)
@@ -396,19 +396,8 @@ class pkgDepCache : protected pkgCache::Namespace
     *  \param rootFunc A predicate that returns \b true for packages
     *  that should be added to the root set.
     */
-   bool MarkAndSweep(InRootSetFunc &rootFunc)
-   {
-     return MarkRequired(rootFunc) && Sweep();
-   }
-
-   bool MarkAndSweep()
-   {
-     std::auto_ptr<InRootSetFunc> f(GetRootSetFunc());
-     if(f.get() != NULL)
-       return MarkAndSweep(*f.get());
-     else
-       return false;
-   }
+   bool MarkAndSweep(InRootSetFunc &rootFunc);
+   bool MarkAndSweep();
 
    /** \name State Manipulators
     */