Author: toad
Date: 2007-03-17 15:42:46 +0000 (Sat, 17 Mar 2007)
New Revision: 12191

Modified:
   trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
Simplify code slightly

Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2007-03-17 
15:28:22 UTC (rev 12190)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2007-03-17 
15:42:46 UTC (rev 12191)
@@ -993,6 +993,9 @@
                                long deleted = 0;
                                for(long i=curBlocks-1;i>=maxBlocks;i--) {

+                                       if(t == null)
+                                               t = 
environment.beginTransaction(null,null);
+                                       
                                        // Delete the block with this blocknum.

                                        DatabaseEntry blockNumEntry = new 
DatabaseEntry();
@@ -1005,10 +1008,7 @@

                                        if((curBlocks-i) % 2048 == 0) {
                                                t.commit();
-                                               if(i-1 >= maxBlocks)
-                                                       t = 
environment.beginTransaction(null,null);
-                                               else
-                                                       t = null; //FIXME: WTF 
? what are we doing here ? if we dereference it, how will the t.commit() out of 
the loop work? btw, what's the purpose of the test above ? 
+                                               t = null; 
                                        }

                                        freeBlocks.remove(i);


Reply via email to