From f18828e9a14707dea65eaba80ba0bd403b0d3268 Mon Sep 17 00:00:00 2001 From: Robert Spalek Date: Wed, 10 Jul 2002 13:56:06 +0000 Subject: [PATCH] HASH_WANT_FIND_NEXT fixed and its declaration changed --- lib/hashtable.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/hashtable.h b/lib/hashtable.h index ef86ecef..c8aeb31f 100644 --- a/lib/hashtable.h +++ b/lib/hashtable.h @@ -44,8 +44,8 @@ * HASH_WANT_CLEANUP cleanup() -- deallocate the hash table. * HASH_WANT_FIND node *find(key) -- find first node with the specified * key, return NULL if no such node exists. - * HASH_WANT_FIND_NEXT node *find(key, node *start) -- find next node with - * the specified key, return NULL if no such node exists. + * HASH_WANT_FIND_NEXT node *find(node *start) -- find next node with the + * specified key, return NULL if no such node exists. * HASH_WANT_NEW node *new(key) -- create new node with given key. * Doesn't check whether it already exists. * HASH_WANT_LOOKUP node *lookup(key) -- find node with given key, @@ -385,20 +385,20 @@ static P(node) * P(find) (HASH_KEY_DECL) #endif #ifdef HASH_WANT_FIND_NEXT -static P(node) * P(find_next) (HASH_KEY_DECL, P(node) *start) +static P(node) * P(find_next) (P(node) *start) { #ifndef HASH_CONSERVE_SPACE - uns h0 = P(hash) (HASH_KEY( )); + uns h0 = P(hash) (HASH_KEY(start->)); #endif P(bucket) *b = SKIP_BACK(P(bucket), n, start); - for (; b; b=b->next) + for (b=b->next; b; b=b->next) { if ( #ifndef HASH_CONSERVE_SPACE b->hash == h0 && #endif - P(eq)(HASH_KEY( ), HASH_KEY(b->n.))) + P(eq)(HASH_KEY(start->), HASH_KEY(b->n.))) return &b->n; } return NULL; -- 2.39.2