Re: Narrow the scope of the variable outputstr in logicalrep_write_tuple

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: japin <japinli(at)hotmail(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Narrow the scope of the variable outputstr in logicalrep_write_tuple
Date: 2021-01-18 20:58:35
Message-ID: 411768.1611003515@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

japin <japinli(at)hotmail(dot)com> writes:
> I find that the outputstr variable in logicalrep_write_tuple() only use in
> `else` branch, I think we can narrow the scope, just like variable outputbytes
> in `if` branch (for more readable).

Agreed, done.

For context, I'm not usually in favor of making one-off stylistic
improvements: the benefit seldom outweighs the risk of creating
merge hazards for future back-patching. But in this case, the
code involved is mostly new in v14, so improving it now doesn't
cost anything in that way.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhihong Yu 2021-01-18 21:09:20 Re: search_plan_tree(): handling of non-leaf CustomScanState nodes causes segfault
Previous Message Joel Jacobson 2021-01-18 20:56:23 Re: Add primary keys to system catalogs