Re: Remove unnecessary else branch

2020-10-13 Thread Tom Lane
Li Japin 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

Re: Remove unnecessary else branch

2020-10-13 Thread Li Japin
On Oct 13, 2020, at 9:59 PM, Hamid Akhtar mailto:hamid.akh...@gmail.com>> wrote: On Tue, Oct 13, 2020 at 6:37 PM Heikki Linnakangas mailto:hlinn...@iki.fi>> wrote: On 13/10/2020 16:30, Li Japin wrote: > Hi, > > I found in guc-file.l we can omit the else branch in AbsoluteConfigLocation().

Re: Remove unnecessary else branch

2020-10-13 Thread Li Japin
On Oct 13, 2020, at 9:59 PM, Hamid Akhtar mailto:hamid.akh...@gmail.com>> wrote: On Tue, Oct 13, 2020 at 6:37 PM Heikki Linnakangas mailto:hlinn...@iki.fi>> wrote: On 13/10/2020 16:30, Li Japin wrote: > Hi, > > I found in guc-file.l we can omit the else branch in AbsoluteConfigLocation().

Re: Remove unnecessary else branch

2020-10-13 Thread Hamid Akhtar
On Tue, Oct 13, 2020 at 6:37 PM Heikki Linnakangas wrote: > On 13/10/2020 16:30, Li Japin wrote: > > Hi, > > > > I found in guc-file.l we can omit the else branch in > AbsoluteConfigLocation(). > > It will compile the same, so it's just a matter of code readability or > taste which style is

Re: Remove unnecessary else branch

2020-10-13 Thread Heikki Linnakangas
On 13/10/2020 16:30, Li Japin wrote: Hi, I found in guc-file.l we can omit the else branch in AbsoluteConfigLocation(). It will compile the same, so it's just a matter of code readability or taste which style is better here. I think we should leave it alone, it's fine as it is. - Heikki

Remove unnecessary else branch

2020-10-13 Thread Li Japin
Hi, I found in guc-file.l we can omit the else branch in AbsoluteConfigLocation(). diff --git a/src/backend/utils/misc/guc-file.l b/src/backend/utils/misc/guc-file.l index c98e220295..9d4b3d7236 100644 --- a/src/backend/utils/misc/guc-file.l +++ b/src/backend/utils/misc/guc-file.l @@ -522,23