Re: Define variables in the approprieate scope - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Define variables in the approprieate scope
Date
Msg-id 20200318230847.GC28341@momjian.us
Whole thread Raw
In response to Define variables in the approprieate scope  (Antonin Houska <ah@cybertec.at>)
Responses Re: Define variables in the approprieate scope
List 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@momjian.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 +



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Make MemoryContextMemAllocated() more precise
Next
From: Alvaro Herrera
Date:
Subject: Re: pgsql: Disk-based Hash Aggregation.