Skip to content

Commit e36e936

Browse files
committed
remove redundant initializations
Reported-by: Ranier Vilela Discussion: https://postgr.es/m/CAEudQAo1+AcGppxDSg8k+zF4+Kv+eJyqzEDdbpDg58-=MQcerQ@mail.gmail.com Author: Ranier Vilela Backpatch-through: master
1 parent 844c05a commit e36e936

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

src/backend/access/gist/gistxlog.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,6 @@ gistRedoPageReuse(XLogReaderState *record)
405405
* logged value is very old, so that XID wrap-around already happened
406406
* on it, there can't be any snapshots that still see it.
407407
*/
408-
nextXid = ReadNextFullTransactionId();
409408
diff = U64FromFullTransactionId(nextXid) -
410409
U64FromFullTransactionId(latestRemovedFullXid);
411410
if (diff < MaxTransactionId / 2)

src/backend/catalog/heap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3436,7 +3436,7 @@ List *
34363436
heap_truncate_find_FKs(List *relationIds)
34373437
{
34383438
List *result = NIL;
3439-
List *oids = list_copy(relationIds);
3439+
List *oids;
34403440
List *parent_cons;
34413441
ListCell *cell;
34423442
ScanKeyData key;

src/backend/storage/smgr/md.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,9 +734,11 @@ mdwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
734734
BlockNumber
735735
mdnblocks(SMgrRelation reln, ForkNumber forknum)
736736
{
737-
MdfdVec *v = mdopenfork(reln, forknum, EXTENSION_FAIL);
737+
MdfdVec *v;
738738
BlockNumber nblocks;
739-
BlockNumber segno = 0;
739+
BlockNumber segno;
740+
741+
mdopenfork(reln, forknum, EXTENSION_FAIL);
740742

741743
/* mdopen has opened the first segment */
742744
Assert(reln->md_num_open_segs[forknum] > 0);

src/backend/utils/adt/json.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ catenate_stringinfo_string(StringInfo buffer, const char *addon)
990990
Datum
991991
json_build_object(PG_FUNCTION_ARGS)
992992
{
993-
int nargs = PG_NARGS();
993+
int nargs;
994994
int i;
995995
const char *sep = "";
996996
StringInfo result;

src/backend/utils/mmgr/mcxt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ MemoryContextMemAllocated(MemoryContext context, bool recurse)
476476

477477
if (recurse)
478478
{
479-
MemoryContext child = context->firstchild;
479+
MemoryContext child;
480480

481481
for (child = context->firstchild;
482482
child != NULL;

0 commit comments

Comments
 (0)