[Aptitude-svn-commit] r3997 - in branches/aptitude-0.3/aptitude: . src/generic

Daniel Burrows dburrows at costa.debian.org
Tue Aug 30 18:39:55 UTC 2005


Author: dburrows
Date: Tue Aug 30 18:39:52 2005
New Revision: 3997

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/generic/immset.h
Log:
Avoid some wtree_node copies.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Tue Aug 30 18:39:52 2005
@@ -1,3 +1,11 @@
+2005-08-30  Daniel Burrows  <dburrows at debian.org>
+
+	* src/generic/immset.h:
+
+	  Slightly optimize for_each and the other immset routines by
+	  avoiding some wtree_node copies (hence avoiding reference-count
+	  updates).
+
 2005-08-30  Christian Perrier  <bubulle at debian.org>
 
 	* po/fr.po: Completed by Jean-Luc Coulon and the French team

Modified: branches/aptitude-0.3/aptitude/src/generic/immset.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/immset.h	(original)
+++ branches/aptitude-0.3/aptitude/src/generic/immset.h	Tue Aug 30 18:39:52 2005
@@ -75,13 +75,13 @@
       }
 
       /** \return the left child. */
-      wtree_node getLeftChild() const
+      const wtree_node &getLeftChild() const
       {
 	return left;
       }
 
       /** \return the right child. */
-      wtree_node getRightChild() const
+      const wtree_node &getRightChild() const
       {
 	return right;
       }
@@ -326,11 +326,11 @@
     {
       if(isValid())
 	{
-	  getLeft().for_each(o);
+	  realNode->getLeftChild().for_each(o);
 
 	  o(getVal());
 
-	  getRight().for_each(o);
+	  realNode->getRightChild().for_each(o);
 	}
     }
   };



More information about the Aptitude-svn-commit mailing list