From 5d11ada701a18fd845146c6d94cfba4ae5ae41c6 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sat, 23 Mar 2013 16:56:17 -0700 Subject: [PATCH] hashtables: remove stack effects from generic methods. --- core/hashtables/hashtables.factor | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/hashtables/hashtables.factor b/core/hashtables/hashtables.factor index 729d18df0b..5a94cccbef 100644 --- a/core/hashtables/hashtables.factor +++ b/core/hashtables/hashtables.factor @@ -121,13 +121,13 @@ PRIVATE> : ( n -- hash ) hashtable new [ reset-hash ] keep ; inline -M: hashtable at* ( key hash -- value ? ) +M: hashtable at* key@ [ 3 fixnum+fast slot t ] [ 2drop f f ] if ; -M: hashtable clear-assoc ( hash -- ) +M: hashtable clear-assoc [ init-hash ] [ array>> [ drop ((empty)) ] map! drop ] bi ; -M: hashtable delete-at ( key hash -- ) +M: hashtable delete-at [ nip ] [ key@ ] 2bi [ [ ((tombstone)) dup ] 2dip set-nth-pair hash-deleted+ @@ -135,13 +135,13 @@ M: hashtable delete-at ( key hash -- ) 3drop ] if ; -M: hashtable assoc-size ( hash -- n ) +M: hashtable assoc-size [ count>> ] [ deleted>> ] bi - ; inline : rehash ( hash -- ) [ >alist ] [ clear-assoc ] [ (rehash) ] tri ; -M: hashtable set-at ( value key hash -- ) +M: hashtable set-at dup ?grow-hash (set-at) ; : associate ( value key -- hash )