[geos-commits] [SCM] geos branch master updated. a625517faf3871999fcbaee5cf0de61e0036d091

git at osgeo.org git at osgeo.org
Thu Sep 7 11:15:58 PDT 2017


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  a625517faf3871999fcbaee5cf0de61e0036d091 (commit)
      from  77dfb8f781d00fb995c3481dca94bb508c4cf373 (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 a625517faf3871999fcbaee5cf0de61e0036d091
Author: Mateusz Loskot <mateusz at loskot.net>
Date:   Thu Sep 7 20:15:18 2017 +0200

    Avoid copying of std::unique_ptr
    
    Prefer T::Ptr instead of std::unique_ptr<T>.

diff --git a/tests/perf/operation/buffer/IteratedBufferStressTest.cpp b/tests/perf/operation/buffer/IteratedBufferStressTest.cpp
index e661e23..1e64c6f 100644
--- a/tests/perf/operation/buffer/IteratedBufferStressTest.cpp
+++ b/tests/perf/operation/buffer/IteratedBufferStressTest.cpp
@@ -63,7 +63,7 @@ void run(const Geometry* base)
 		     << totalSW << endl; // totalSW.getTimeString() << endl;
 
 		dist += 1;
-		base = b2.get(); tmp = b2;
+		base = b2.get(); tmp = std::move(b2); // move as anti-optimisation?
 
 		if ( ! base->getNumPoints() ) break;
 	}
diff --git a/tests/perf/operation/predicate/RectangleIntersectsPerfTest.cpp b/tests/perf/operation/predicate/RectangleIntersectsPerfTest.cpp
index 654e675..400f5ac 100644
--- a/tests/perf/operation/predicate/RectangleIntersectsPerfTest.cpp
+++ b/tests/perf/operation/predicate/RectangleIntersectsPerfTest.cpp
@@ -48,7 +48,7 @@ public:
   {
     double size = 100;
     Coordinate origin(0, 0);
-    unique_ptr<Geometry> sinePoly (
+    Geometry::Ptr sinePoly (
       createSineStar(origin, size, nPts)->getBoundary()
     );
 
@@ -60,7 +60,7 @@ public:
     using geos::precision::SimpleGeometryPrecisionReducer;
     PrecisionModel pm(size/10);
     SimpleGeometryPrecisionReducer reducer(&pm);
-    unique_ptr<Geometry> sinePolyCrinkly ( reducer.reduce(sinePoly.get()) );
+    Geometry::Ptr sinePolyCrinkly ( reducer.reduce(sinePoly.get()) );
     sinePoly.reset();
 
     Geometry& target = *sinePolyCrinkly;
@@ -78,7 +78,7 @@ private:
   static const int NUM_LINE_PTS = 1000;
 
   PrecisionModel pm;
-  GeometryFactory::unique_ptr fact;
+  GeometryFactory::Ptr fact;
 
   void testRectangles(const Geometry& target, int nRect, double rectSize)
   {
@@ -128,7 +128,7 @@ private:
     }
   }
 
-  unique_ptr<Polygon> createSineStar(const Coordinate& origin,
+  Polygon::Ptr createSineStar(const Coordinate& origin,
                                     double size, int nPts)
   {
       using geos::geom::util::SineStarFactory;
@@ -139,7 +139,7 @@ private:
       gsf.setNumPoints(nPts);
       gsf.setArmLengthRatio(2);
       gsf.setNumArms(20);
-      unique_ptr<Polygon> poly = gsf.createSineStar();
+      Polygon::Ptr poly = gsf.createSineStar();
       return poly;
   }
 

-----------------------------------------------------------------------

Summary of changes:
 tests/perf/operation/buffer/IteratedBufferStressTest.cpp     |    2 +-
 .../perf/operation/predicate/RectangleIntersectsPerfTest.cpp |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
geos


More information about the geos-commits mailing list