[geos-commits] r2989 - trunk/src/operation/buffer
svn_geos at osgeo.org
svn_geos at osgeo.org
Sat May 15 08:47:02 EDT 2010
Author: strk
Date: 2010-05-15 08:47:00 -0400 (Sat, 15 May 2010)
New Revision: 2989
Modified:
trunk/src/operation/buffer/OffsetCurveBuilder.cpp
Log:
Minor tweaks
Modified: trunk/src/operation/buffer/OffsetCurveBuilder.cpp
===================================================================
--- trunk/src/operation/buffer/OffsetCurveBuilder.cpp 2010-05-15 12:31:33 UTC (rev 2988)
+++ trunk/src/operation/buffer/OffsetCurveBuilder.cpp 2010-05-15 12:47:00 UTC (rev 2989)
@@ -203,6 +203,12 @@
int side, double distance,
vector<CoordinateSequence*>& lineList)
{
+ // optimize creating ring for zero distance
+ if (distance == 0.0) {
+ lineList.push_back(inputPts->clone());
+ return;
+ }
+
init(distance);
if (inputPts->getSize() <= 2)
{
@@ -210,17 +216,10 @@
return;
}
- // optimize creating ring for zero distance
- if (distance == 0.0) {
- vertexList.reset(); // is this needed ?
- lineList.push_back(inputPts->clone());
- return;
- }
-
computeRingBufferCurve(*inputPts, side);
- // this will be vertexList
- // NOTE: getCoordinates() take ownership of the CoordinateSequence
+ // NOTE: ownership of coordinates is transferred from vertexList
+ // to lineList
lineList.push_back(vertexList.getCoordinates());
}
@@ -232,8 +231,6 @@
maxCurveSegmentError = distance * (1 - cos(filletAngleQuantum/2.0));
// Point list needs to be reset
- // but if a previous point list exists
- // we'd better back it up for final deletion
vertexList.reset();
vertexList.setPrecisionModel(precisionModel);
More information about the geos-commits
mailing list