A spot of redundant initialization of brin memtuple - Mailing list pgsql-hackers

From Richard Guo
Subject A spot of redundant initialization of brin memtuple
Date
Msg-id CAMbWs4-kYYpKNOdiWtsCZ3jbkFFj4nhOVH22JH7dsrMYX=aGjg@mail.gmail.com
Whole thread Raw
Responses Re: A spot of redundant initialization of brin memtuple
List pgsql-hackers
Happened to notice this when reading around the codes. The BrinMemTuple
would be initialized in brin_new_memtuple(), right after being created.
So we don't need to initialize it again outside.

diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c
index ccc9fa0959..67a277e1f9 100644
--- a/src/backend/access/brin/brin.c
+++ b/src/backend/access/brin/brin.c
@@ -1261,8 +1261,6 @@ initialize_brin_buildstate(Relation idxRel, BrinRevmap *revmap,
        state->bs_bdesc = brin_build_desc(idxRel);
        state->bs_dtuple = brin_new_memtuple(state->bs_bdesc);

-       brin_memtuple_initialize(state->bs_dtuple, state->bs_bdesc);
-
        return state;
 }

Thanks
Richard

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Some RELKIND macro refactoring
Next
From: Michael Paquier
Date:
Subject: Re: drop tablespace failed when location contains .. on win32