Skip to content

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

@leecarraher-8451

Description

@leecarraher-8451

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions