diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-01-18 09:11:04 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-01-18 09:11:04 +0000 |
| commit | f12d6a57fe5cc18be5afd164061578d8e00d75ce (patch) | |
| tree | 7fd1a501a8a545fbf2326ead48cd041928699c5e /src/2geom/basic-intersection.cpp | |
| parent | update to trunk (diff) | |
| parent | Fix missing embeded image condition, kindly caught by suv in bug #1270334 (diff) | |
| download | inkscape-f12d6a57fe5cc18be5afd164061578d8e00d75ce.tar.gz inkscape-f12d6a57fe5cc18be5afd164061578d8e00d75ce.zip | |
update to trunk
(bzr r11950.1.235)
Diffstat (limited to 'src/2geom/basic-intersection.cpp')
| -rw-r--r-- | src/2geom/basic-intersection.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/2geom/basic-intersection.cpp b/src/2geom/basic-intersection.cpp index 544bf0dd1..379ec597c 100644 --- a/src/2geom/basic-intersection.cpp +++ b/src/2geom/basic-intersection.cpp @@ -64,15 +64,13 @@ void find_intersections(std::vector< std::pair<double, double> > & xs, void split(vector<Point> const &p, double t, vector<Point> &left, vector<Point> &right) { const unsigned sz = p.size(); - - Geom::Point **Vtemp = new Geom::Point* [sz]; - - for (unsigned int i = 0; i < sz; ++i) { - Vtemp[i] = new Geom::Point[sz]; - } + //Geom::Point Vtemp[sz][sz]; + vector<vector<Point> > Vtemp(sz); + for ( size_t i = 0; i < sz; ++i ) + Vtemp[i].reserve(sz); /* Copy control points */ - std::copy(p.begin(), p.end(), Vtemp[0]); + std::copy(p.begin(), p.end(), Vtemp[0].begin()); /* Triangle computation */ for (unsigned i = 1; i < sz; i++) { @@ -87,11 +85,6 @@ void split(vector<Point> const &p, double t, left[j] = Vtemp[j][0]; for (unsigned j = 0; j < sz; j++) right[j] = Vtemp[sz-1-j][j]; - - for (unsigned int i = 0; i < sz; ++i) - delete[] Vtemp[i]; - - delete[] Vtemp; } |
