pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove useless Asserts in Result Cache code
Date: Fri, 02 Apr 2021 21:42:04 +0000
Message-ID: <E1lSRYK-0005S2-Ve@gemulon.postgresql.org> (raw)

Remove useless Asserts in Result Cache code

Testing if an unsigned variable is >= 0 is pretty pointless.

There's likely enough code in remove_cache_entry() to verify the cache
memory accounting is correct in assert enabled builds. These Asserts
were not adding much extra cover, even if they had been checking >= 0 on a
signed variable.

Reported-by: Andres Freund
Discussion: https://postgr.es/m/20210402204734.6mo3nfacnljlicgn@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1267d9862fc6a4f8cdc0ca38d1988b61f39da585

Modified Files
--------------
src/backend/executor/nodeResultCache.c | 4 ----
1 file changed, 4 deletions(-)



Message-ID: <E1lSRYK-0005S2-Ve@gemulon.postgresql.org>
Permalink:  ../E1lSRYK-0005S2-Ve@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lSRYK-0005S2-Ve@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: drowley@postgresql.org
  Subject: Re: pgsql: Remove useless Asserts in Result Cache code
  In-Reply-To: <E1lSRYK-0005S2-Ve@gemulon.postgresql.org>
  References: <E1lSRYK-0005S2-Ve@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox