]> gitweb.factorcode.org Git - factor.git/commitdiff
Making <hash-set> faster
authorDaniel Ehrenberg <littledan@Macintosh-122.local>
Thu, 18 Mar 2010 00:12:25 +0000 (20:12 -0400)
committerDaniel Ehrenberg <littledan@Macintosh-122.local>
Thu, 18 Mar 2010 00:12:25 +0000 (20:12 -0400)
core/hash-sets/hash-sets.factor

index 248b4af4c6c2e56a470b3394417d4bbcfb3bef92..b4bf9a1aef049f5d2a5b2e58fbe4c00b1f623f6e 100644 (file)
@@ -9,7 +9,7 @@ IN: hash-sets
 TUPLE: hash-set { table hashtable read-only } ;
 
 : <hash-set> ( members -- hash-set )
-    [ dup ] H{ } map>assoc hash-set boa ;
+    H{ } clone [ [ dupd set-at ] curry each ] keep hash-set boa ;
 
 INSTANCE: hash-set set
 M: hash-set in? table>> key? ; inline