diff --git a/09-cuckoo_hash/python/cuckoo_hash.py b/09-cuckoo_hash/python/cuckoo_hash.py index 73f223e679ab99de7b3b0699cb8fc3141cac80a4..a224d648b40958ea8e79747bad2cc196230c22f0 100644 --- a/09-cuckoo_hash/python/cuckoo_hash.py +++ b/09-cuckoo_hash/python/cuckoo_hash.py @@ -46,8 +46,7 @@ class CuckooTable: b0 = self.hashes[0].hash(key) b1 = self.hashes[1].hash(key) # print("## Lookup key={} b0={} b1={}".format(key, b0, b1)) - return (self.table[b0] is not None and self.table[b0] == key) or \ - (self.table[b1] is not None and self.table[b1] == key) + return self.table[b0] == key or self.table[b1] == key def insert(self, key): """Insert a new key to the table. Assumes that the key is not present yet."""