Re: [PATCH] Remove some duplicate if conditions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Remove some duplicate if conditions
Date
Msg-id 384.1388685595@sss.pgh.pa.us
Whole thread Raw
In response to [PATCH] Remove some duplicate if conditions  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: [PATCH] Remove some duplicate if conditions  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> I've attached a simple patch which removes some duplicate if conditions
> that seemed to have found their way into the code.

> These are per PVS-Studio's warnings.

-1.  If PVS-Studio is complaining about this type of coding, to hell with
it; it should just optimize away the extra tests and be quiet about it,
not opinionate about coding style.  What you propose would cause logically
independent pieces of code to become tied together, and I don't find that
to be an improvement.  It's the compiler's job to micro-optimize where
possible, and most compilers that I've seen will do that rather than tell
the programmer he ought to do it.
        regards, tom lane




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: preserving forensic information when we freeze
Next
From: Robert Haas
Date:
Subject: Re: fix_PGSTAT_NUM_TABENTRIES_macro patch