pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove useless check for negative result of ip_addrsize().
Date: Thu, 10 Apr 2025 18:18:22 +0000
Message-ID: <E1u2wTm-003cyQ-2j@gemulon.postgresql.org> (raw)

Remove useless check for negative result of ip_addrsize().

By inspection, ip_addrsize() can't return a negative result.
(If it could, we'd have way bigger problems elsewhere.)
So delete useless check in network_send().  Most C compilers
are probably perfectly capable of removing this code by
themselves, but it's confusing/misleading.

Bug: #18889
Reported-by: Daniel Elishakov <dan-eli@mail.ru>
Discussion: https://postgr.es/m/18889-73d4f19e953a629e@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f27eb0325b7b2cff3b880fa669913693849521dc

Modified Files
--------------
src/backend/utils/adt/network.c | 2 --
1 file changed, 2 deletions(-)



Message-ID: <E1u2wTm-003cyQ-2j@gemulon.postgresql.org>
Permalink:  ../E1u2wTm-003cyQ-2j@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1u2wTm-003cyQ-2j@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Remove useless check for negative result of ip_addrsize().
  In-Reply-To: <E1u2wTm-003cyQ-2j@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