pgsql: Reduce scope of for-loop-local variables to avoid shadowing

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Reduce scope of for-loop-local variables to avoid shadowing
Date: 2026-03-03 12:11:52
Message-ID: E1vxObQ-002AMr-25@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Reduce scope of for-loop-local variables to avoid shadowing

Adjust a couple of for-loops where a local variable was shadowed by
another in the same scope, by renaming it as well as reducing its scope
to the containing for-loop.

Author: Chao Li <lic(at)highgo(dot)com>
Reviewed-by: Peter Smith <smithpb2250(at)gmail(dot)com>
Reviewed-by: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Discussion: https://postgr.es/m/CAEoWx2kQ2x5gMaj8tHLJ3=jfC+p5YXHkJyHrDTiQw2nn2FJTmQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cece37c9843c980b5be2f6d24c2b9cef1f9429a7

Modified Files
--------------
src/backend/backup/basebackup_incremental.c | 10 ++++------
src/backend/parser/parse_target.c | 10 ++++------
2 files changed, 8 insertions(+), 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2026-03-03 12:20:23 pgsql: doc: Add restart on failure to example systemd file
Previous Message Peter Eisentraut 2026-03-03 09:08:42 pgsql: Reduce the scope of volatile qualifiers