[mapserver-commits] r13236 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Tue Mar 13 07:59:50 EDT 2012
Author: tbonfort
Date: 2012-03-13 04:59:50 -0700 (Tue, 13 Mar 2012)
New Revision: 13236
Modified:
trunk/mapserver/mapprimitive.c
Log:
tiny memory optimization in msClipXXXRect: reuse the pointObj* array in some cases
Modified: trunk/mapserver/mapprimitive.c
===================================================================
--- trunk/mapserver/mapprimitive.c 2012-03-13 11:50:21 UTC (rev 13235)
+++ trunk/mapserver/mapprimitive.c 2012-03-13 11:59:50 UTC (rev 13236)
@@ -527,10 +527,13 @@
y1 = shape->line[i].point[j].y;
}
- if(line.numpoints > 0)
- msAddLine(&tmp, &line);
- free(line.point);
- line.numpoints = 0; /* new line */
+ if(line.numpoints > 0) {
+ msAddLineDirectly(&tmp, &line);
+ }
+ else {
+ free(line.point);
+ line.numpoints = 0; /* new line */
+ }
}
for (i=0; i<shape->numlines; i++) free(shape->line[i].point);
@@ -538,6 +541,7 @@
shape->line = tmp.line;
shape->numlines = tmp.numlines;
+ msComputeBounds(shape);
}
/*
@@ -680,10 +684,10 @@
line.point[line.numpoints].x = line.point[0].x; /* force closure */
line.point[line.numpoints].y = line.point[0].y;
line.numpoints++;
- msAddLine(&tmp, &line);
+ msAddLineDirectly(&tmp, &line);
+ } else {
+ free(line.point);
}
-
- free(line.point);
} /* next line */
for (i=0; i<shape->numlines; i++) free(shape->line[i].point);
More information about the mapserver-commits
mailing list