mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Remove useless casts to (void *) in hash_search() calls
Some of these appear to be leftovers from when hash_search() took a
char * argument (changed in 5999e78fc4
).
Since after this there is some more horizontal space available, do
some light reformatting where suitable.
Reviewed-by: Corey Huinker <corey.huinker@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/fd9adf5d-b1aa-e82f-e4c7-263c30145807%40enterprisedb.com
This commit is contained in:
@ -262,7 +262,7 @@ ReservePrivateRefCountEntry(void)
|
||||
|
||||
/* enter victim array entry into hashtable */
|
||||
hashent = hash_search(PrivateRefCountHash,
|
||||
(void *) &(ReservedRefCountEntry->buffer),
|
||||
&(ReservedRefCountEntry->buffer),
|
||||
HASH_ENTER,
|
||||
&found);
|
||||
Assert(!found);
|
||||
@ -336,10 +336,7 @@ GetPrivateRefCountEntry(Buffer buffer, bool do_move)
|
||||
if (PrivateRefCountOverflowed == 0)
|
||||
return NULL;
|
||||
|
||||
res = hash_search(PrivateRefCountHash,
|
||||
(void *) &buffer,
|
||||
HASH_FIND,
|
||||
NULL);
|
||||
res = hash_search(PrivateRefCountHash, &buffer, HASH_FIND, NULL);
|
||||
|
||||
if (res == NULL)
|
||||
return NULL;
|
||||
@ -368,10 +365,7 @@ GetPrivateRefCountEntry(Buffer buffer, bool do_move)
|
||||
free->refcount = res->refcount;
|
||||
|
||||
/* delete from hashtable */
|
||||
hash_search(PrivateRefCountHash,
|
||||
(void *) &buffer,
|
||||
HASH_REMOVE,
|
||||
&found);
|
||||
hash_search(PrivateRefCountHash, &buffer, HASH_REMOVE, &found);
|
||||
Assert(found);
|
||||
Assert(PrivateRefCountOverflowed > 0);
|
||||
PrivateRefCountOverflowed--;
|
||||
@ -430,10 +424,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref)
|
||||
bool found;
|
||||
Buffer buffer = ref->buffer;
|
||||
|
||||
hash_search(PrivateRefCountHash,
|
||||
(void *) &buffer,
|
||||
HASH_REMOVE,
|
||||
&found);
|
||||
hash_search(PrivateRefCountHash, &buffer, HASH_REMOVE, &found);
|
||||
Assert(found);
|
||||
Assert(PrivateRefCountOverflowed > 0);
|
||||
PrivateRefCountOverflowed--;
|
||||
|
Reference in New Issue
Block a user