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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Don't use is_infinite() where isinf() will do.
Date: 2018-10-06 17:18:46
Message-ID: E1g8qE2-0007W5-8e@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)1538794717(at)sss(dot)pgh(dot)pa(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-10-06 19:13:02 pgsql: Remove more redundant relation locking during executor startup.
Previous Message Tom Lane 2018-10-06 16:00:35 pgsql: Propagate xactStartTimestamp and stmtStartTimestamp to parallel