labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1502327 - /labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/Leaf.java
Date Thu, 11 Jul 2013 19:01:04 GMT
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


Mime
View raw message