diff options
| author | Peter Eisentraut <peter@eisentraut.org> | 2023-02-06 09:05:20 +0100 |
|---|---|---|
| committer | Peter Eisentraut <peter@eisentraut.org> | 2023-02-06 09:41:01 +0100 |
| commit | 54a177a948b0a773c25c6737d1cc3cc49222a526 (patch) | |
| tree | a442be10d2b8515f6b1600f60838e379ee546fe8 /src/backend/replication/logical/reorderbuffer.c | |
| parent | 009f8d17146da72478fcb8f544b793c443fa254c (diff) | |
| download | postgresql-54a177a948b0a773c25c6737d1cc3cc49222a526.tar.gz | |
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 5999e78fc45dcb91784b64b6e9ae43f4e4f68ca2).
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
Diffstat (limited to 'src/backend/replication/logical/reorderbuffer.c')
| -rw-r--r-- | src/backend/replication/logical/reorderbuffer.c | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index efe057b4de..0468d12936 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -657,7 +657,7 @@ ReorderBufferTXNByXid(ReorderBuffer *rb, TransactionId xid, bool create, /* search the lookup table */ ent = (ReorderBufferTXNByIdEnt *) hash_search(rb->by_txn, - (void *) &xid, + &xid, create ? HASH_ENTER : HASH_FIND, &found); if (found) @@ -1581,10 +1581,7 @@ ReorderBufferCleanupTXN(ReorderBuffer *rb, ReorderBufferTXN *txn) dclist_delete_from(&rb->catchange_txns, &txn->catchange_node); /* now remove reference from buffer */ - hash_search(rb->by_txn, - (void *) &txn->xid, - HASH_REMOVE, - &found); + hash_search(rb->by_txn, &txn->xid, HASH_REMOVE, &found); Assert(found); /* remove entries spilled to disk */ @@ -1762,10 +1759,7 @@ ReorderBufferBuildTupleCidHash(ReorderBuffer *rb, ReorderBufferTXN *txn) &key.tid); ent = (ReorderBufferTupleCidEnt *) - hash_search(txn->tuplecid_hash, - (void *) &key, - HASH_ENTER, - &found); + hash_search(txn->tuplecid_hash, &key, HASH_ENTER, &found); if (!found) { ent->cmin = change->data.tuplecid.cmin; @@ -4653,10 +4647,7 @@ ReorderBufferToastAppendChunk(ReorderBuffer *rb, ReorderBufferTXN *txn, Assert(!isnull); ent = (ReorderBufferToastEnt *) - hash_search(txn->toast_hash, - (void *) &chunk_id, - HASH_ENTER, - &found); + hash_search(txn->toast_hash, &chunk_id, HASH_ENTER, &found); if (!found) { @@ -4811,7 +4802,7 @@ ReorderBufferToastReplace(ReorderBuffer *rb, ReorderBufferTXN *txn, */ ent = (ReorderBufferToastEnt *) hash_search(txn->toast_hash, - (void *) &toast_pointer.va_valueid, + &toast_pointer.va_valueid, HASH_FIND, NULL); if (ent == NULL) @@ -5053,10 +5044,7 @@ ApplyLogicalMappingFile(HTAB *tuplecid_data, Oid relid, const char *fname) ent = (ReorderBufferTupleCidEnt *) - hash_search(tuplecid_data, - (void *) &key, - HASH_FIND, - NULL); + hash_search(tuplecid_data, &key, HASH_FIND, NULL); /* no existing mapping, no need to update */ if (!ent) @@ -5067,10 +5055,7 @@ ApplyLogicalMappingFile(HTAB *tuplecid_data, Oid relid, const char *fname) &key.tid); new_ent = (ReorderBufferTupleCidEnt *) - hash_search(tuplecid_data, - (void *) &key, - HASH_ENTER, - &found); + hash_search(tuplecid_data, &key, HASH_ENTER, &found); if (found) { @@ -5249,10 +5234,7 @@ ResolveCminCmaxDuringDecoding(HTAB *tuplecid_data, restart: ent = (ReorderBufferTupleCidEnt *) - hash_search(tuplecid_data, - (void *) &key, - HASH_FIND, - NULL); + hash_search(tuplecid_data, &key, HASH_FIND, NULL); /* * failed to find a mapping, check whether the table was rewritten and |
