cuckoo-delete ( bytes cuckoo-filter -- ? )


Vocabulary
cuckoo-filters

Inputs
bytesa byte-array
cuckoo-filtera cuckoo-filter


Outputs
?a boolean


Word description
Remove the data from the cuckoo-filter, returning t if the data appears to be removed.

Definition


:: cuckoo-delete ( bytes cuckoo-filter -- ? )
bytes cuckoo-filter hash-indices :> ( fp i1 i2 )
cuckoo-filter buckets>> :> buckets buckets length :> n {
[ fp i1 n mod buckets nth bucket-delete ]
[ fp i2 n mod buckets nth bucket-delete ]
} 0|| dup [ cuckoo-filter [ 1 - ] change-size drop ] when ;