Patch by Daniel Baston
git-svn-id: http://svn.osgeo.org/postgis/trunk@13864
b70326c6-7e19-0410-871a-
916f4a2858ee
* Enhancements *
+ - #3223, Add memcmp short-circuit to ST_Equals (Daniel Baston)
- #2278, Make liblwgeom compatible between minor releases
- #897, ST_AsX3D support for GeoCoordinates and systems "GD" "WE"
ability to flip x/y axis (use option = 2, 3)
}
}
+ /*
+ * short-circuit: if geom1 and geom2 are binary-equivalent, we can return
+ * TRUE. This is much faster than doing the comparison using GEOS.
+ */
+ if (VARSIZE(geom1) == VARSIZE(geom2) && !memcmp(geom1, geom2, VARSIZE(geom1))) {
+ PG_RETURN_BOOL(TRUE);
+ }
+
initGEOS(lwpgnotice, lwgeom_geos_error);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);