Simplify box_overlap computations.
Tom Lane <tgl@sss.pgh.pa.us>
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
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/geo_ops.c | modified | +4 −9 |