Re: Speedup usages of pg_*toa() functions - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: Speedup usages of pg_*toa() functions
Date
Msg-id 87v9jz5qsl.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: Speedup usages of pg_*toa() functions  (Ranier Vilela <ranier.vf@gmail.com>)
List pgsql-hackers
>>>>> "Ranier" == Ranier Vilela <ranier.vf@gmail.com> writes:

 Ranier> Sorry, my mistake.

 Ranier> uvalue = (uint64) 0 - value;

This doesn't gain anything over the original, and it has the downside of
hiding an int64 to uint64 conversion that is actually quite sensitive.
For example, it might tempt someone to rewrite it as

    uvalue = -value;

which is actually incorrect (though our -fwrapv will hide the error).

-- 
Andrew (irc:RhodiumToad)



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Resetting spilled txn statistics in pg_stat_replication
Next
From: Michael Paquier
Date:
Subject: Re: Terminate the idle sessions