Re: [PATCH v1] remove redundant check of item pointer - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH v1] remove redundant check of item pointer
Date
Msg-id 3170808.1657839551@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH v1] remove redundant check of item pointer  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: [PATCH v1] remove redundant check of item pointer
List pgsql-hackers
Peter Geoghegan <pg@bowt.ie> writes:
> The proposal doesn't seem like an improvement. Technically the
> assertion cannot possibly fail here because the earlier assertion
> would always fail instead, so strictly speaking it is redundant -- at
> least right now. That is true. But it seems much more important to be
> consistent about which variant to use. Especially because there is
> obviously no overhead in builds without assertions enabled.

Even in an assert-enabled build, wouldn't you expect the compiler to
optimize away the second assertion as unreachable code?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: doc: New cumulative stats subsystem obsoletes comment in maintenance.sgml
Next
From: Peter Geoghegan
Date:
Subject: Re: [PATCH v1] remove redundant check of item pointer