Re: Define variables in the approprieate scope

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Define variables in the approprieate scope
Date: 2020-03-18 23:08:47
Message-ID: 20200318230847.GC28341@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 25, 2020 at 09:35:52AM +0100, Antonin Houska wrote:
> I've noticed that two variables in RelationCopyStorage() are defined in a
> scope higher than necessary. Please see the patch.

It seems cleaner to me to allocate the variables once before the loop
starts, rather than for each loop iteration.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EnterpriseDB https://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-03-18 23:24:04 Re: pgsql: Disk-based Hash Aggregation.
Previous Message Jeff Davis 2020-03-18 22:54:49 pgsql: Disk-based Hash Aggregation.