You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by el...@apache.org on 2013/07/11 21:01:04 UTC

svn commit: r1502327 - /labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/Leaf.java

Author: elecharny
Date: Thu Jul 11 19:01:03 2013
New Revision: 1502327

URL: http://svn.apache.org/r1502327
Log:
Fixed a bug in the delete() method : the page was not copied if we haven't removed any key in it

Modified:
    labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/Leaf.java

Modified: labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/Leaf.java
URL: http://svn.apache.org/viewvc/labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/Leaf.java?rev=1502327&r1=1502326&r2=1502327&view=diff
==============================================================================
--- labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/Leaf.java (original)
+++ labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/Leaf.java Thu Jul 11 19:01:03 2013
@@ -281,8 +281,18 @@ import org.apache.mavibot.btree.exceptio
                 return defaultResult;
             }
         }
+        else
+        {
+            // Last, not least : we can copy the full page
+            // Copy the keys and the values
+            System.arraycopy( keys, 0, newLeaf.keys, 0, nbElems );
+            System.arraycopy( values, 0, newLeaf.values, 0, nbElems );
+
+            // The current page is added in the copied page list
+            defaultResult.addCopiedPage( this );
 
-        return defaultResult;
+            return defaultResult;
+        }
     }
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org