Thread: pgsql: Improve coding of gistchoose and gistRelocateBuildBuffersOnSplit

pgsql: Improve coding of gistchoose and gistRelocateBuildBuffersOnSplit

From
Tom Lane
Date:
Improve coding of gistchoose and gistRelocateBuildBuffersOnSplit.

This is mostly cosmetic, but it does eliminate a speculative portability
issue.  The previous coding ignored the fact that sum_grow could easily
overflow (in fact, it could be summing multiple IEEE float infinities).
On a platform where that didn't guarantee to produce a positive result,
the code would misbehave.  In any case, it was less than readable.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/e5db11c5582b469c04a11f217a0f32c827da5dd7

Modified Files
--------------
src/backend/access/gist/gistbuildbuffers.c |   84 ++++++++++++--------
src/backend/access/gist/gistutil.c         |  113 +++++++++++++++-------------
2 files changed, 110 insertions(+), 87 deletions(-)