diff --git a/core/hash-sets/hash-sets.factor b/core/hash-sets/hash-sets.factor index bfafe4ee39..9e99dc6a1a 100644 --- a/core/hash-sets/hash-sets.factor +++ b/core/hash-sets/hash-sets.factor @@ -10,10 +10,7 @@ IN: hash-sets TUPLE: hash-set { count array-capacity } { deleted array-capacity } - { array array initial: { - T{ tombstone } T{ tombstone } T{ tombstone } T{ tombstone } - } - } ; + { array array } ; hash@ -] unit-test +USING: accessors assocs continuations fry hashtables kernel make +math namespaces sequences tools.test ; { H{ } } [ { } [ dup ] H{ } map>assoc ] unit-test @@ -188,14 +182,5 @@ H{ } "x" set { 1 } [ 2 "h" get at ] unit-test -! Previously this could break as hashtable new created a backing an -! empty backing array and the code assumed its length was > 0. -{ f f } [ - compact-gc 77 hashtable new [ clone ] change-array at* -] unit-test - ! Random test case -{ "A" } [ - 100 iota [ dup ] H{ } map>assoc 32 over - delete-at "A" 32 pick set-at 32 of -] unit-test +{ "A" } [ 100 iota [ dup ] H{ } map>assoc 32 over delete-at "A" 32 pick set-at 32 of ] unit-test diff --git a/core/hashtables/hashtables.factor b/core/hashtables/hashtables.factor index 33d0c3ace9..d7763428d7 100644 --- a/core/hashtables/hashtables.factor +++ b/core/hashtables/hashtables.factor @@ -4,16 +4,10 @@ USING: accessors arrays assocs kernel kernel.private math math.private sequences sequences.private slots.private vectors ; IN: hashtables -! Required because the hashtable definition references tombstone. - - TUPLE: hashtable { count array-capacity } { deleted array-capacity } - { array array initial: { - T{ tombstone } T{ tombstone } T{ tombstone } T{ tombstone } - } - } ; + { array array } ;