cuckoo-filters: less duplication in cuckoo-insert.

char-rename
John Benediktsson 2016-08-08 19:39:24 -07:00
parent c09cfd586c
commit ed29fbd93f
1 changed files with 3 additions and 3 deletions

View File

@ -62,7 +62,7 @@ TUPLE: cuckoo-filter buckets checksum size ;
[ fp i1 n mod buckets nth bucket-insert ]
[ fp i2 n mod buckets nth bucket-insert ]
} 0|| [
cuckoo-filter [ 1 + ] change-size drop t
t
] [
2 random zero? i1 i2 ? :> i!
max-cuckoo-count [
@ -71,9 +71,9 @@ TUPLE: cuckoo-filter buckets checksum size ;
fp i alt-index i!
fp i n mod buckets nth bucket-insert
dup [ cuckoo-filter [ 1 + ] change-size drop ] when
] find-integer >boolean
] if ;
] if
dup [ cuckoo-filter [ 1 + ] change-size drop ] when ;
:: cuckoo-lookup ( bytes cuckoo-filter -- ? )
bytes cuckoo-filter hash-indices :> ( fp i1 i2 )