From: Sandro Santilli Date: Mon, 22 Sep 2014 09:02:56 +0000 (+0000) Subject: Reduce default paranoia on geometry collection construction X-Git-Tag: 2.2.0rc1~836 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66ab2235b64a38183a8d0c660e949b0008217133;p=postgis Reduce default paranoia on geometry collection construction Significantly speeds up creation of large collection of geometries. Closes #2933 git-svn-id: http://svn.osgeo.org/postgis/trunk@12993 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwcollection.c b/liblwgeom/lwcollection.c index 82dd5ac9a..16e39b01d 100644 --- a/liblwgeom/lwcollection.c +++ b/liblwgeom/lwcollection.c @@ -199,8 +199,9 @@ LWCOLLECTION* lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom) /* Allocate more space if we need it */ lwcollection_reserve(col, col->ngeoms + 1); +#if PARANOIA_LEVEL > 1 + /* See http://trac.osgeo.org/postgis/ticket/2933 */ /* Make sure we don't already have a reference to this geom */ - /* TODO: drop this check ... */ for ( i = 0; i < col->ngeoms; i++ ) { if ( col->geoms[i] == geom ) @@ -209,6 +210,7 @@ LWCOLLECTION* lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom) return col; } } +#endif col->geoms[col->ngeoms] = (LWGEOM*)geom; col->ngeoms++;