Author: elecharny
Date: Wed Jun 20 08:27:38 2012
New Revision: 1351989
URL: http://svn.apache.org/viewvc?rev=1351989&view=rev
Log:
Fixed a bug in the find() method for Node : we were selecting the wrong children
Modified:
labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/Node.java
Modified:
labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/Node.java
URL:
http://svn.apache.org/viewvc/labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/Node.java?rev=1351989&r1=1351988&r2=1351989&view=diff
==============================================================================
--- labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/Node.java
(original)
+++ labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/Node.java
Wed Jun 20 08:27:38 2012
@@ -158,7 +158,9 @@ public class Node<K, V> extends Abstract
if ( pos < 0 )
{
- return children[- ( pos + 1 ) ].find( key );
+ // Here, if we have found the key in the node, then we must go
down into
+ // the right child, not the left one
+ return children[- pos ].find( key );
}
else
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]