]> granicus.if.org Git - postgis/commitdiff
Reduce default paranoia on geometry collection construction
authorSandro Santilli <strk@keybit.net>
Mon, 22 Sep 2014 09:02:56 +0000 (09:02 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 22 Sep 2014 09:02:56 +0000 (09:02 +0000)
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

liblwgeom/lwcollection.c

index 82dd5ac9a874200e1470ea364594f60f43cae646..16e39b01d36b50c28cd54f98255cb6405131a4af 100644 (file)
@@ -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++;