diff options
author | hdu <duerr@sun.com> | 2009-10-22 15:55:15 +0200 |
---|---|---|
committer | hdu <duerr@sun.com> | 2009-10-22 15:55:15 +0200 |
commit | aa99d186de8cd2841cd7aabc371f68f1e05bae1f (patch) | |
tree | 9f1ae6ae5abf09c7a5995981421d57f63330dd9b /basegfx/source | |
parent | 6d8370250d2e64ff8ea6047fae628ee68df1f822 (diff) |
#i106127# more pre-allocations to prevent reallocations
Diffstat (limited to 'basegfx/source')
-rw-r--r-- | basegfx/source/polygon/b2dpolygoncutandtouch.cxx | 1 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolygontools.cxx | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx index e35e22ae3a04..da6ff8904725 100644 --- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx +++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx @@ -711,6 +711,7 @@ namespace basegfx // create subdivided polygon and find cuts on it // Keep adaptiveSubdivideByCount due to needed quality + aTempPolygon.reserve(SUBDIVIDE_FOR_CUT_TEST_COUNT + 8); aTempPolygon.append(rCubicA.getStartPoint()); rCubicA.adaptiveSubdivideByCount(aTempPolygon, SUBDIVIDE_FOR_CUT_TEST_COUNT); findTouches(aTempPolygon, rPointPolygon, aTempPointVector); diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index 038ad0b35300..7485387c6cb9 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -7,7 +7,6 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: b2dpolygontools.cxx,v $ - * $Revision: 1.29.4.1 $ * * This file is part of OpenOffice.org. * @@ -3278,6 +3277,9 @@ namespace basegfx B2DCubicBezier aBezier; aBezier.setStartPoint(rCandidate.getB2DPoint(0)); + // try to avoid costly reallocations + aRetval.reserve( nEdgeCount+1); + // add start point aRetval.append(aBezier.getStartPoint()); |