diff options
Diffstat (limited to 'src/backend/lib/hasht.c')
-rw-r--r-- | src/backend/lib/hasht.c | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/src/backend/lib/hasht.c b/src/backend/lib/hasht.c index baceabfcf7a..4e12dcf30eb 100644 --- a/src/backend/lib/hasht.c +++ b/src/backend/lib/hasht.c @@ -1,14 +1,14 @@ /*------------------------------------------------------------------------- * * hasht.c-- - * hash table related functions that are not directly supported - * by the hashing packages under utils/hash. + * hash table related functions that are not directly supported + * by the hashing packages under utils/hash. * * Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/lib/Attic/hasht.c,v 1.4 1997/08/12 22:52:42 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/lib/Attic/hasht.c,v 1.5 1997/09/07 04:42:03 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -19,29 +19,31 @@ #include <lib/hasht.h> /* ----------------------------------- - * HashTableWalk + * HashTableWalk * - * call function on every element in hashtable - * one extra argument, arg may be supplied + * call function on every element in hashtable + * one extra argument, arg may be supplied * ----------------------------------- */ void -HashTableWalk(HTAB *hashtable, HashtFunc function, int arg) +HashTableWalk(HTAB * hashtable, HashtFunc function, int arg) { - long *hashent; - long *data; - int keysize; - - keysize = hashtable->hctl->keysize; - hash_seq((HTAB *)NULL); - while ((hashent = hash_seq(hashtable)) != (long *) TRUE) { - if (hashent == NULL) - elog(FATAL, "error in HashTableWalk."); - /* - * XXX the corresponding hash table insertion does NOT - * LONGALIGN -- make sure the keysize is ok - */ - data = (long *) LONGALIGN((char*) hashent + keysize); - (*function)(data, arg); - } + long *hashent; + long *data; + int keysize; + + keysize = hashtable->hctl->keysize; + hash_seq((HTAB *) NULL); + while ((hashent = hash_seq(hashtable)) != (long *) TRUE) + { + if (hashent == NULL) + elog(FATAL, "error in HashTableWalk."); + + /* + * XXX the corresponding hash table insertion does NOT LONGALIGN + * -- make sure the keysize is ok + */ + data = (long *) LONGALIGN((char *) hashent + keysize); + (*function) (data, arg); + } } |