Re: Remove unnecessary else branch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Li Japin <japinli(at)hotmail(dot)com>
Cc: Hamid Akhtar <hamid(dot)akhtar(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Remove unnecessary else branch
Date: 2020-10-13 15:25:03
Message-ID: 3438915.1602602703@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Li Japin <japinli(at)hotmail(dot)com> writes:
> I agree with Heikki from the code execution point of view.

> In code execution point of view they are same, however, the code is for user, i think the readability is also important.

There is another consideration here, which is avoiding creating
back-patching hazards from gratuitous cross-branch code differences.

If you need to rewrite a chunk of logic anyway, then fixing
small cosmetic issues in it is fine. Otherwise I think "leave
well enough alone" is a good guiding principle.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2020-10-13 16:09:44 Re: partition routing layering in nodeModifyTable.c
Previous Message Tom Lane 2020-10-13 15:16:56 Re: Assertion failure with LEFT JOINs among >500 relations