public inbox for [email protected]
help / color / mirror / Atom feedFrom: Peter Smith <[email protected]>
To: Chao Li <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: Postgres hackers <[email protected]>
Subject: Re: Cleanup shadows variable warnings, round 1
Date: Thu, 4 Dec 2025 12:08:37 +1100
Message-ID: <CAHut+PveN-xpSAPeFunXr1sYQEPL729k_NAFiEoCBA=XdR82SA@mail.gmail.com> (raw)
In-Reply-To: <CAHut+PvrcSUabnsuH+77+yEwvjiLHy0XJiLuTtVHWed_MHdwMw@mail.gmail.com>
References: <CAEoWx2kQ2x5gMaj8tHLJ3=jfC+p5YXHkJyHrDTiQw2nn2FJTmQ@mail.gmail.com>
<[email protected]>
<CAEoWx2kjuQTQg=ZO76R7yKSj27zEHqehhL15UaK2D=vAw2JgYw@mail.gmail.com>
<CAHut+PvrcSUabnsuH+77+yEwvjiLHy0XJiLuTtVHWed_MHdwMw@mail.gmail.com>
FWIW... A few more review comments for v3.
//////////
Patch v3-0001.
//////////
======
src/backend/access/gist/gistbuild.c
2.1.
OK, but should you take it 1 step further?
BEFORE
foreach(lc, splitinfo)
{
GISTPageSplitInfo *si = lfirst(lc);
AFTER
foreach_ptr(GISTPageSplitInfo, si, splitinfo)
{
======
src/backend/commands/schemacmds.c
2.2.
OK, but should you take it 1 step further?
BEFORE
foreach(parsetree_item, parsetree_list)
{
Node *substmt = (Node *) lfirst(parsetree_item);
AFTER
foreach_ptr(Node, substmt, parsetree_list)
{
======
src/backend/commands/statscmds.c
2.3.
OK, but I felt 'attnums_bms' might be a better replacement name than 'attnumsbm'
======
src/backend/executor/nodeValuesscan.c
2.4.
OK, but should you take it 1 step further?
BEFORE
foreach(lc, exprstatelist)
{
ExprState *exprstate = (ExprState *) lfirst(lc);
AFTER
foreach_ptr(ExprState, exprstate, exprstatelist)
{
======
src/backend/statistics/dependencies.c
2.5.
The other variable in other parts of this function had names like:
clause_expr
bool_expr
or_expr
stat_expr
So, perhaps your new names should be changed slightly to look more
similar to those?
======
src/backend/statistics/extended_stats.c
2.6.
This seems to be in the wrong patch because here you renamed the local
var, not the inner one, as the patch commit message says.
======
src/backend/utils/adt/jsonpath_exec.c
2.7.
Wondering if 'vals' might be a better name than 'foundJV' (there is
already another JsonValueList vals elsewhere in this code).
======
src/bin/pgbench/pgbench.c
2.8.
Wondering if 'nskipped' is a better name than 'skips'.
//////////
Patch v3-0003
//////////
LGTM.
======
Kind Regards,
Peter Smith.
Fujitsu Australia
view thread (30+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Cleanup shadows variable warnings, round 1
In-Reply-To: <CAHut+PveN-xpSAPeFunXr1sYQEPL729k_NAFiEoCBA=XdR82SA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox