This patch makes a minor code cleanup in dynahash.c: a function declared
to return 'bool' only ever returned "true", so I changed it to return
"void".
I'll apply this to CVS before the end of the day, barring any
objections.
-Neil
--- src/backend/utils/hash/dynahash.c
+++ src/backend/utils/hash/dynahash.c
@@ -66,7 +66,7 @@
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 @@
return NULL;
}
- if (!hdefault(hashp))
- return NULL;
+ hdefault(hashp);
hctl = hashp->hctl;
#ifdef HASH_STATISTICS
@@ -254,7 +253,7 @@
/*
* Set default HASHHDR parameters.
*/
-static bool
+static void
hdefault(HTAB *hashp)
{
HASHHDR *hctl = hashp->hctl;
@@ -268,8 +268,6 @@
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 +277,6 @@
/* garbage collection for HASH_REMOVE */
hctl->freeList = NULL;
-
- return true;
}
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html