Re: backend/nodes cleanup: Move loop variables definitions into for statement

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: backend/nodes cleanup: Move loop variables definitions into for statement
Date: 2025-11-19 09:36:55
Message-ID: e0aba2c1-64ca-4e6f-bbe5-4302a6234099@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12.11.25 09:00, Chao Li wrote:
> While working on the other patch [1] that touched tbm_add_tuples() under
> src/backend/nodes, I moved a loop variable into for statement by the way
> as I knew Peter Eisentraut had done some efforts about that, see [2].
>
> However, Peter removed that change from the patch and he said that
> should belong to a separate cleanup patch. So I am following up and
> moving loop variables into for statements wherever possible under src/
> backend/nodes.

In a couple of cases, you are changing the type of the loop variable
from Size to int. I would not expect such a change in a patch of this
nature. If you have a reason to change it, please explain it (but I
doubt the change is correct).

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shlok Kyal 2025-11-19 10:04:04 Re: Skipping schema changes in publication
Previous Message Kirill Reshke 2025-11-19 09:35:39 Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)