Thread

Commits

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

  2. formatting.c cleanup: Move loop variables definitions into for statement

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

    Chao Li <li.evan.chao@gmail.com> — 2025-11-12T08:00:19Z

    Hi Hackers,
    
    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.
    
    [1]
    https://www.postgresql.org/message-id/flat/CAEoWx2m2E0xE8Kvbkv31ULh_E+5zph-WA_bEdv3UR9CLhw+3vg@mail.gmail.com
    [2]
    https://git.postgresql.org/cgit/postgresql.git/commit/?id=03fbb0814c5015ab79e670ab97bb6a3349269e4b
    
    Best regards,
    --
    Chao Li (Evan)
    HighGo Software Co., Ltd.
    https://www.highgo.com/
    
  2. Re: backend/nodes cleanup: Move loop variables definitions into for statement

    Chao Li <li.evan.chao@gmail.com> — 2025-11-14T13:52:08Z

    On Wed, Nov 12, 2025 at 4:00 PM Chao Li <li.evan.chao@gmail.com> wrote:
    
    > Hi Hackers,
    >
    > 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.
    >
    > [1]
    > https://www.postgresql.org/message-id/flat/CAEoWx2m2E0xE8Kvbkv31ULh_E+5zph-WA_bEdv3UR9CLhw+3vg@mail.gmail.com
    > [2]
    > https://git.postgresql.org/cgit/postgresql.git/commit/?id=03fbb0814c5015ab79e670ab97bb6a3349269e4b
    >
    >
    Rebased to V2.
    
    Best regards,
    Chao Li (Evan)
    ---------------------
    HighGo Software Co., Ltd.
    https://www.highgo.com/
    
  3. Re: backend/nodes cleanup: Move loop variables definitions into for statement

    Chao Li <li.evan.chao@gmail.com> — 2025-11-17T12:55:13Z

    Added to CF: https://commitfest.postgresql.org/patch/6227/
    
    > On Nov 14, 2025, at 21:52, Chao Li <li.evan.chao@gmail.com> wrote:
    > 
    > 
    > 
    > On Wed, Nov 12, 2025 at 4:00 PM Chao Li <li.evan.chao@gmail.com> wrote:
    > Hi Hackers,
    > 
    > 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.
    > 
    > [1] https://www.postgresql.org/message-id/flat/CAEoWx2m2E0xE8Kvbkv31ULh_E+5zph-WA_bEdv3UR9CLhw+3vg@mail.gmail.com
    > [2] https://git.postgresql.org/cgit/postgresql.git/commit/?id=03fbb0814c5015ab79e670ab97bb6a3349269e4b
    > 
    > 
    > Rebased to V2.
    > 
    > Best regards,
    > Chao Li (Evan)
    > ---------------------
    > HighGo Software Co., Ltd.
    > https://www.highgo.com/
    > 
    >  <v2-0001-backend-nodes-cleanup-Move-loop-variables-definit.patch>
    
    --
    Chao Li (Evan)
    HighGo Software Co., Ltd.
    https://www.highgo.com/
    
    
    
    
    
    
    
    
  4. Re: backend/nodes cleanup: Move loop variables definitions into for statement

    Peter Eisentraut <peter@eisentraut.org> — 2025-11-19T09:36:55Z

    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).
    
    
    
    
    
  5. Re: backend/nodes cleanup: Move loop variables definitions into for statement

    Chao Li <li.evan.chao@gmail.com> — 2025-11-19T10:32:41Z

    On Wed, Nov 19, 2025 at 5:36 PM Peter Eisentraut <peter@eisentraut.org>
    wrote:
    
    >
    >
    > 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).
    >
    >
    That was a mistake. I fixed it in v3.
    
    Best regards,
    Chao Li (Evan)
    ---------------------
    HighGo Software Co., Ltd.
    https://www.highgo.com/
    
  6. Re: backend/nodes cleanup: Move loop variables definitions into for statement

    Peter Eisentraut <peter@eisentraut.org> — 2025-11-24T15:00:04Z

    On 19.11.25 11:32, Chao Li wrote:
    > On Wed, Nov 19, 2025 at 5:36 PM Peter Eisentraut <peter@eisentraut.org 
    > <mailto:peter@eisentraut.org>> wrote:
    > 
    > 
    > 
    >     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).
    > 
    > 
    > That was a mistake. I fixed it in v3.
    
    Still not correct in outDatum().
    
    
    
    
    
  7. Re: backend/nodes cleanup: Move loop variables definitions into for statement

    Chao Li <li.evan.chao@gmail.com> — 2025-11-24T23:38:23Z

    On Mon, Nov 24, 2025 at 11:00 PM Peter Eisentraut <peter@eisentraut.org>
    wrote:
    
    > On 19.11.25 11:32, Chao Li wrote:
    > > On Wed, Nov 19, 2025 at 5:36 PM Peter Eisentraut <peter@eisentraut.org
    > > <mailto:peter@eisentraut.org>> wrote:
    > >
    > >
    > >
    > >     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).
    > >
    > >
    > > That was a mistake. I fixed it in v3.
    >
    > Still not correct in outDatum().
    >
    >
    Oops! Fixed in v4.
    
    Best regards,
    Chao Li (Evan)
    ---------------------
    HighGo Software Co., Ltd.
    https://www.highgo.com/
    
  8. Re: backend/nodes cleanup: Move loop variables definitions into for statement

    Chao Li <li.evan.chao@gmail.com> — 2025-11-25T03:46:27Z

    On Tue, Nov 25, 2025 at 7:38 AM Chao Li <li.evan.chao@gmail.com> wrote:
    
    >
    > On Mon, Nov 24, 2025 at 11:00 PM Peter Eisentraut <peter@eisentraut.org>
    > wrote:
    >
    >> On 19.11.25 11:32, Chao Li wrote:
    >> > On Wed, Nov 19, 2025 at 5:36 PM Peter Eisentraut <peter@eisentraut.org
    >> > <mailto:peter@eisentraut.org>> wrote:
    >> >
    >> >
    >> >
    >> >     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).
    >> >
    >> >
    >> > That was a mistake. I fixed it in v3.
    >>
    >> Still not correct in outDatum().
    >>
    >>
    > Oops! Fixed in v4.
    >
    >
    Rebased to v5.
    
    Chao Li (Evan)
    ---------------------
    HighGo Software Co., Ltd.
    https://www.highgo.com/
    
  9. Re: backend/nodes cleanup: Move loop variables definitions into for statement

    Peter Eisentraut <peter@eisentraut.org> — 2025-11-25T14:46:39Z

    On 25.11.25 04:46, Chao Li wrote:
    > 
    > On Tue, Nov 25, 2025 at 7:38 AM Chao Li <li.evan.chao@gmail.com 
    > <mailto:li.evan.chao@gmail.com>> wrote:
    > 
    > 
    >     On Mon, Nov 24, 2025 at 11:00 PM Peter Eisentraut
    >     <peter@eisentraut.org <mailto:peter@eisentraut.org>> wrote:
    > 
    >         On 19.11.25 11:32, Chao Li wrote:
    >          > On Wed, Nov 19, 2025 at 5:36 PM Peter Eisentraut
    >         <peter@eisentraut.org <mailto:peter@eisentraut.org>
    >          > <mailto:peter@eisentraut.org <mailto:peter@eisentraut.org>>>
    >         wrote:
    >          >
    >          >
    >          >
    >          >     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).
    >          >
    >          >
    >          > That was a mistake. I fixed it in v3.
    > 
    >         Still not correct in outDatum().
    > 
    > 
    >     Oops! Fixed in v4.
    > 
    > 
    > Rebased to v5.
    
    committed