Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit121aca3

Browse files
author
Neil Conway
committed
Minor code cleanup: hdefault() only ever returned "true", so it may as
well be declared to return "void" to save callers the trouble ofchecking for errors.
1 parenta57df8d commit121aca3

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

‎src/backend/utils/hash/dynahash.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/utils/hash/dynahash.c,v 1.54 2004/09/28 20:46:34 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/utils/hash/dynahash.c,v 1.55 2004/10/22 07:21:06 neilc Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -66,7 +66,7 @@ static HASHSEGMENT seg_alloc(HTAB *hashp);
6666
staticboolelement_alloc(HTAB*hashp,intnelem);
6767
staticbooldir_realloc(HTAB*hashp);
6868
staticboolexpand_table(HTAB*hashp);
69-
staticboolhdefault(HTAB*hashp);
69+
staticvoidhdefault(HTAB*hashp);
7070
staticboolinit_htab(HTAB*hashp,longnelem);
7171
staticvoidhash_corrupted(HTAB*hashp);
7272

@@ -178,8 +178,7 @@ hash_create(const char *tabname, long nelem, HASHCTL *info, int flags)
178178
returnNULL;
179179
}
180180

181-
if (!hdefault(hashp))
182-
returnNULL;
181+
hdefault(hashp);
183182

184183
hctl=hashp->hctl;
185184
#ifdefHASH_STATISTICS
@@ -254,7 +253,7 @@ hash_create(const char *tabname, long nelem, HASHCTL *info, int flags)
254253
/*
255254
* Set default HASHHDR parameters.
256255
*/
257-
staticbool
256+
staticvoid
258257
hdefault(HTAB*hashp)
259258
{
260259
HASHHDR*hctl=hashp->hctl;
@@ -268,8 +267,6 @@ hdefault(HTAB *hashp)
268267
hctl->nentries=0;
269268
hctl->nsegs=0;
270269

271-
/* I added these MS. */
272-
273270
/* rather pointless defaults for key & entry size */
274271
hctl->keysize=sizeof(char*);
275272
hctl->entrysize=2*sizeof(char*);
@@ -279,8 +276,6 @@ hdefault(HTAB *hashp)
279276

280277
/* garbage collection for HASH_REMOVE */
281278
hctl->freeList=NULL;
282-
283-
return true;
284279
}
285280

286281

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp