hash-sets: faster intersects?.

db4
John Benediktsson 2013-03-26 16:00:31 -07:00
parent 28b194d5fc
commit 200e37671f
1 changed files with 6 additions and 0 deletions

View File

@ -138,6 +138,12 @@ INSTANCE: hash-set set
M: hash-set intersect (intersect) >hash-set ;
M: hash-set intersects?
over hash-set? [
small/large [ array>> ] dip [ in? ] curry
[ if ] curry [ dup tombstone? [ drop t ] ] prepose any?
] [ small/large sequence/tester any? ] if ;
M: hash-set union
over hash-set? [
small/large [ array>> ] [ clone ] bi*