Permalink
Browse files

Merge pull request #20 from bitterb/fix-pure-ruby-bf

Fix the pure-ruby implementation of bloom filter to work correctly.
  • Loading branch information...
2 parents 78169ff + c3df21c commit 163d0cdc3f4d540ae62cf25f0264d201af827286 @igrigorik igrigorik committed Oct 9, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 examples/pure-ruby-bf.rb
@@ -10,8 +10,8 @@ class BloomFilter
def initialize(max_entries, num_hashes, seed)
@num_hashes = num_hashes
@size = max_entries.to_i
- @bitmap = BitSet.new(@size)
- @__mask = BitSet.new(@size)
+ @bitmap = Bitset.new(@size)
+ @__mask = Bitset.new(@size)
@seed = seed
end
@@ -41,7 +41,7 @@ def main
while line = ARGF.gets
data = line.chop
- if bf.new_entry?(data)
+ if bf.new?(data)
num += 1
bf.insert(data)
end

0 comments on commit 163d0cd

Please sign in to comment.