Re: Remove repeated calls to PQserverVersion

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove repeated calls to PQserverVersion
Date: 2021-07-14 00:19:30
Message-ID: 202107140019.wqu2ewt56oxi@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2021-Jul-14, Peter Smith wrote:

> But I never made any claims about performance; my motivation for this
> trivial patch was more like just "code tidy" or "refactor", so
> applying performance as the only worthiness criteria for a "code tidy"
> patch seemed like a misrepresentation here.
>
> Of course you can judge the patch is still not worthwhile for other
> reasons. So be it.

Personally, I like the simplicity of the function call in those places,
because when reading just that line one immediately knows where the
value is coming from. If you assign it to a variable, the line is not
standalone and I have to find out where the assignment is, and verify
that there hasn't been any other assignment in between.

--
Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/
"Pido que me den el Nobel por razones humanitarias" (Nicanor Parra)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2021-07-14 00:46:44 Re: enable_resultcache confusion
Previous Message Stephen Frost 2021-07-14 00:18:35 Re: proposal: possibility to read dumped table's name from file