Simplify box_overlap computations.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: f806c191a3d5faa1af1e5032d394fc6c5f93df86
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2013-02-08T23:26:08Z
Releases: 9.3.0
Simplify box_overlap computations.

Given the assumption that a box's high coordinates are not less than its
low coordinates, the tests in box_ov() are overly complicated and can be
reduced to about half as much work.  Since many other functions in
geo_ops.c rely on that assumption, there doesn't seem to be a good reason
not to use it here.

Per discussion of Alexander Korotkov's GiST fix, which was already using
the simplified logic (in a non-fuzzy form, but the equivalence holds just
as well for fuzzy).

Files

PathChange+/−
src/backend/utils/adt/geo_ops.c modified +4 −9