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

Daniel Burrows dburrows at costa.debian.org
Wed Aug 31 23:43:07 UTC 2005


Author: dburrows
Date: Wed Aug 31 23:43:04 2005
New Revision: 4030

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/generic/immset.h
Log:
When removing a node with children, don't lose the right child
of its right child's minimum element.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Wed Aug 31 23:43:04 2005
@@ -1,5 +1,13 @@
 2005-08-31  Daniel Burrows  <dburrows at debian.org>
 
+	* src/generic/immset.h:
+
+	  When extracting and removing the minimum element of a tree,
+	  remember that while the minimum has (by definition) no *left*
+	  children, it might have a *right* child.  Thus, instead of just
+	  replacing the removed element with an empty tree, replace it
+	  with its right child.
+
 	* src/generic/immset.h, tests/interactive_set_test.cc:
 
 	  Make the set dump a dump() routine instead of operator<<, since

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	Wed Aug 31 23:43:04 2005
@@ -510,7 +510,7 @@
       }
       else
       {
-	return std::pair<node, Val>(node(), n.getVal());
+	return std::pair<node, Val>(n.getRight(), n.getVal());
       }
     }
 



More information about the Aptitude-svn-commit mailing list