diff options
author | Neil Conway <neilc@samurai.com> | 2004-10-22 07:21:06 +0000 |
---|---|---|
committer | Neil Conway <neilc@samurai.com> | 2004-10-22 07:21:06 +0000 |
commit | 121aca39ba2e77dedc7ec1bf4f3570e194cdd883 (patch) | |
tree | ba0293cae77c27a5cd21ec2088608df9ff1dc775 | |
parent | a57df8d50d5f391a8b93e6a0f28716f63e69f6a9 (diff) | |
download | postgresql-121aca39ba2e77dedc7ec1bf4f3570e194cdd883.tar.gz postgresql-121aca39ba2e77dedc7ec1bf4f3570e194cdd883.zip |
Minor code cleanup: hdefault() only ever returned "true", so it may as
well be declared to return "void" to save callers the trouble of
checking for errors.
-rw-r--r-- | src/backend/utils/hash/dynahash.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c index 8078994ba55..020589ba7b1 100644 --- a/src/backend/utils/hash/dynahash.c +++ b/src/backend/utils/hash/dynahash.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/hash/dynahash.c,v 1.54 2004/09/28 20:46:34 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/hash/dynahash.c,v 1.55 2004/10/22 07:21:06 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -66,7 +66,7 @@ static HASHSEGMENT seg_alloc(HTAB *hashp); static bool element_alloc(HTAB *hashp, int nelem); static bool dir_realloc(HTAB *hashp); static bool expand_table(HTAB *hashp); -static bool hdefault(HTAB *hashp); +static void hdefault(HTAB *hashp); static bool init_htab(HTAB *hashp, long nelem); static void hash_corrupted(HTAB *hashp); @@ -178,8 +178,7 @@ hash_create(const char *tabname, long nelem, HASHCTL *info, int flags) return NULL; } - if (!hdefault(hashp)) - return NULL; + hdefault(hashp); hctl = hashp->hctl; #ifdef HASH_STATISTICS @@ -254,7 +253,7 @@ hash_create(const char *tabname, long nelem, HASHCTL *info, int flags) /* * Set default HASHHDR parameters. */ -static bool +static void hdefault(HTAB *hashp) { HASHHDR *hctl = hashp->hctl; @@ -268,8 +267,6 @@ hdefault(HTAB *hashp) hctl->nentries = 0; hctl->nsegs = 0; - /* I added these MS. */ - /* rather pointless defaults for key & entry size */ hctl->keysize = sizeof(char *); hctl->entrysize = 2 * sizeof(char *); @@ -279,8 +276,6 @@ hdefault(HTAB *hashp) /* garbage collection for HASH_REMOVE */ hctl->freeList = NULL; - - return true; } |