Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert Fails due to attempt to swap fingerprints in an empty bucket #4

Open
leecarraher-8451 opened this issue May 26, 2022 · 0 comments

Comments

@leecarraher-8451
Copy link

cuckoo/filter.py in insert(self, item)
221 for _ in range(self.max_kicks):
222 # Swap the item's fingerprint with a fingerprint in the bucket
--> 223 fingerprint = self.buckets[index].swap(fingerprint)
224
225 # Save the swapped fingerprint here so we can restore it later

cuckoo/bucket.py in swap(self, fingerprint)
99 # TODO: Investigate if there is a better solution for this cause this
100 # is a form of local limit of Cuckoo filter.
--> 101 rindex = random.choice([i for i in range(len(self.bucket))
102 if fingerprint != self.bucket[i]])
103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant