hash-sets: initialize hashtable capacity to length of sequence.
parent
863262ece7
commit
f2aa8ec876
|
@ -9,7 +9,9 @@ IN: hash-sets
|
||||||
TUPLE: hash-set { table hashtable read-only } ;
|
TUPLE: hash-set { table hashtable read-only } ;
|
||||||
|
|
||||||
: <hash-set> ( members -- hash-set )
|
: <hash-set> ( members -- hash-set )
|
||||||
H{ } clone [ [ dupd set-at ] curry each ] keep hash-set boa ;
|
dup length <hashtable> [
|
||||||
|
[ dupd set-at ] curry each
|
||||||
|
] keep hash-set boa ;
|
||||||
|
|
||||||
INSTANCE: hash-set set
|
INSTANCE: hash-set set
|
||||||
M: hash-set in? table>> key? ; inline
|
M: hash-set in? table>> key? ; inline
|
||||||
|
|
Loading…
Reference in New Issue