]> gitweb.factorcode.org Git - factor.git/commitdiff
hash-sets: faster M\ hash-set union.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 23 Mar 2013 04:52:56 +0000 (21:52 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 23 Mar 2013 04:52:56 +0000 (21:52 -0700)
core/hash-sets/hash-sets.factor

index a094c015b23ce2b4d40a10d132ccfd2b39879ab4..b01fe6fa9e204767d9ebda6b95646c144a2f5fda 100644 (file)
@@ -136,7 +136,8 @@ INSTANCE: hash-set set
 
 M: hash-set intersect small/large sequence/tester filter >hash-set ;
 
-M: hash-set union (union) >hash-set ;
+M: hash-set union
+    [ ?members ] [ clone ] bi* [ [ adjoin ] curry each ] keep ;
 
 M: hash-set diff sequence/tester [ not ] compose filter >hash-set ;