[geos-commits] [SCM] GEOS branch master updated. 2225015d8d1ebae33389c01a4751e67f365e25e7

git at osgeo.org git at osgeo.org
Wed May 29 06:30:15 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  2225015d8d1ebae33389c01a4751e67f365e25e7 (commit)
      from  73ca614ccce4b4e773d4ad0d7a9aa7f707665793 (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 2225015d8d1ebae33389c01a4751e67f365e25e7
Author: Daniel Baston <dbaston at gmail.com>
Date:   Wed May 29 09:30:04 2019 -0400

    Remove unneeded Coordinate copies in InteriorPointArea

diff --git a/src/algorithm/InteriorPointArea.cpp b/src/algorithm/InteriorPointArea.cpp
index 95f73bf..6239249 100644
--- a/src/algorithm/InteriorPointArea.cpp
+++ b/src/algorithm/InteriorPointArea.cpp
@@ -183,13 +183,13 @@ private:
 
         const CoordinateSequence* seq = ring.getCoordinatesRO();
         for (size_t i = 1; i < seq->size(); i++) {
-            Coordinate ptPrev = seq->getAt(i - 1);
-            Coordinate pt = seq->getAt(i);
+            const Coordinate& ptPrev = seq->getAt(i - 1);
+            const Coordinate& pt = seq->getAt(i);
             addEdgeCrossing(ptPrev, pt, interiorPointY, crossings);
         }
     }
 
-    void addEdgeCrossing(Coordinate& p0, Coordinate& p1, double scanY, vector<double>& crossings)
+    void addEdgeCrossing(const Coordinate& p0, const Coordinate& p1, double scanY, vector<double>& crossings)
     {
         // skip non-crossing segments
         if (!intersectsHorizontalLine(p0, p1, scanY))
@@ -206,7 +206,7 @@ private:
     void findBestMidpoint(vector<double>& crossings)
     {
         // zero-area polygons will have no crossings
-        if (crossings.size() == 0) return;
+        if (crossings.empty()) return;
 
         //Assert.isTrue(0 == crossings.size() % 2, "Interior Point robustness failure: odd number of scanline crossings");
 
@@ -230,7 +230,7 @@ private:
     }
 
     static bool
-    isEdgeCrossingCounted(Coordinate& p0, Coordinate& p1, double scanY)
+    isEdgeCrossingCounted(const Coordinate& p0, const Coordinate& p1, double scanY)
     {
         // skip horizontal lines
         if (p0.y == p1.y)

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

Summary of changes:
 src/algorithm/InteriorPointArea.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list