[geos-commits] [SCM] GEOS branch master updated. 2cc400bb642970bab1f817b184d3dfd295471bbc
git at osgeo.org
git at osgeo.org
Tue Sep 17 18:53:03 PDT 2019
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".
The branch, master has been updated
via 2cc400bb642970bab1f817b184d3dfd295471bbc (commit)
via c226576245b384338af43202d11a58a14953fa9b (commit)
from a119a6e37b3a2640562e454c05463e336b1f1eea (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2cc400bb642970bab1f817b184d3dfd295471bbc
Author: Daniel Baston <dbaston at gmail.com>
Date: Tue Sep 17 21:46:42 2019 -0400
Simplify GeometryFactory usage in GeometryEditor
diff --git a/src/geom/util/GeometryEditor.cpp b/src/geom/util/GeometryEditor.cpp
index 940417d..1c15a6d 100644
--- a/src/geom/util/GeometryEditor.cpp
+++ b/src/geom/util/GeometryEditor.cpp
@@ -147,27 +147,27 @@ std::unique_ptr<GeometryCollection>
GeometryEditor::editGeometryCollection(const GeometryCollection* collection, GeometryEditorOperation* operation)
{
auto newCollection = operation->edit(collection, factory);
- auto geometries = detail::make_unique<std::vector<Geometry*>>();
+ std::vector<std::unique_ptr<Geometry>> geometries;
for(std::size_t i = 0, n = newCollection->getNumGeometries(); i < n; i++) {
auto geometry = edit(newCollection->getGeometryN(i),
operation);
if(geometry->isEmpty()) {
continue;
}
- geometries->push_back(geometry.release());
+ geometries.push_back(std::move(geometry));
}
if(newCollection->getGeometryTypeId() == GEOS_MULTIPOINT) {
- return std::unique_ptr<GeometryCollection>(factory->createMultiPoint(geometries.release()));
+ return factory->createMultiPoint(std::move(geometries));
}
else if(newCollection->getGeometryTypeId() == GEOS_MULTILINESTRING) {
- return std::unique_ptr<GeometryCollection>(factory->createMultiLineString(geometries.release()));
+ return factory->createMultiLineString(std::move(geometries));
}
else if(newCollection->getGeometryTypeId() == GEOS_MULTIPOLYGON) {
- return std::unique_ptr<GeometryCollection>(factory->createMultiPolygon(geometries.release()));
+ return factory->createMultiPolygon(std::move(geometries));
}
else {
- return std::unique_ptr<GeometryCollection>(factory->createGeometryCollection(geometries.release()));
+ return factory->createGeometryCollection(std::move(geometries));
}
}
commit c226576245b384338af43202d11a58a14953fa9b
Author: Daniel Baston <dbaston at gmail.com>
Date: Tue Sep 17 21:46:00 2019 -0400
Use empty geometry constructor in GeometryCombiner
diff --git a/src/geom/util/GeometryCombiner.cpp b/src/geom/util/GeometryCombiner.cpp
index 949e21f..d99c350 100644
--- a/src/geom/util/GeometryCombiner.cpp
+++ b/src/geom/util/GeometryCombiner.cpp
@@ -89,7 +89,7 @@ GeometryCombiner::combine()
if(elems.empty()) {
if(geomFactory != nullptr) {
- return std::unique_ptr<Geometry>(geomFactory->createGeometryCollection(nullptr));
+ return std::unique_ptr<Geometry>(geomFactory->createGeometryCollection());
}
return nullptr;
}
-----------------------------------------------------------------------
Summary of changes:
src/geom/util/GeometryCombiner.cpp | 2 +-
src/geom/util/GeometryEditor.cpp | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list