Re: Nitpick/question: Use of aliases for global variables in functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Nitpick/question: Use of aliases for global variables in functions
Date: 2021-08-20 03:25:00
Message-ID: 1823922.1629429900@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Corey Huinker <corey(dot)huinker(at)gmail(dot)com> writes:
> In src/backend/access/transam/xact.c, I'm noticing a code style
> inconsistency.
> [ to wit, local variable alias for CurrentTransactionState or not ]
> Is this something worth standardizing, and if so, which style do we like
> better?

I can't get excited about changing this. There may be historical
reasons for the differences, eg maybe at one time there was more
than one reference to the struct in IsTransactionState(). Or maybe
it was just different people doing it a bit differently. It's not
really a big enough difference to be a hindrance to readers, IMO
anyway, so I'd leave it alone.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul Guo 2021-08-20 03:33:33 Re: Two patches to speed up pg_rewind.
Previous Message Corey Huinker 2021-08-20 02:57:20 Nitpick/question: Use of aliases for global variables in functions