Author: toad
Date: 2008-08-26 21:26:46 +0000 (Tue, 26 Aug 2008)
New Revision: 22182

Modified:
   branches/db4o/freenet/src/freenet/support/CountingBloomFilter.java
Log:
Doh!
Fix the fix.
Now it passes the test for setting/checking as well as for false positives 
ratio.


Modified: branches/db4o/freenet/src/freenet/support/CountingBloomFilter.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/CountingBloomFilter.java  
2008-08-26 21:12:19 UTC (rev 22181)
+++ branches/db4o/freenet/src/freenet/support/CountingBloomFilter.java  
2008-08-26 21:26:46 UTC (rev 22182)
@@ -69,7 +69,7 @@
                b &= ~(3 << offset % 4 * 2); // unset bit
                b |= (v + 1) << offset % 4 * 2; // set bit

-               filter.put(offset / 8 * 2, b);
+               filter.put(offset / 4, b);
        }

        @Override
@@ -83,7 +83,7 @@
                b &= ~(3 << offset % 4 * 2); // unset bit
                b |= (v - 1) << offset % 4 * 2; // set bit

-               filter.put(offset / 8 * 2, b);
+               filter.put(offset / 4, b);
        }

        @Override


Reply via email to