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: Don't use is_infinite() where isinf() will do.
Date: Sat, 06 Oct 2018 17:18:46 +0000
Message-ID: <E1g8qE2-0007W5-8e@gemulon.postgresql.org> (raw)

Don't use is_infinite() where isinf() will do.

Places that aren't testing for sign should not use the more expensive
function; it's just wasteful, not to mention being a cognitive load
for readers who may know what isinf() is but not is_infinite().

As things stand, we actually don't need is_infinite() anyplace except
float4out/float8out, which means it could potentially go away altogether
after the changes I proposed in <13178.1538794717@sss.pgh.pa.us>.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0209f0285d9b1c60bf74cc9f5f0133d7bdd887c3

Modified Files
--------------
src/backend/utils/adt/formatting.c          |  4 ++--
src/backend/utils/adt/rangetypes_selfuncs.c | 14 ++++++++------
2 files changed, 10 insertions(+), 8 deletions(-)



Message-ID: <E1g8qE2-0007W5-8e@gemulon.postgresql.org>
Permalink:  ../E1g8qE2-0007W5-8e@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1g8qE2-0007W5-8e@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Don't use is_infinite() where isinf() will do.
  In-Reply-To: <E1g8qE2-0007W5-8e@gemulon.postgresql.org>
  References: <E1g8qE2-0007W5-8e@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