[geos-commits] [SCM] GEOS branch master updated. 6848dcc371536fd47519781d8e5e454ce9d40652

git at osgeo.org git at osgeo.org
Mon Dec 17 13:26:39 PST 2018


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  6848dcc371536fd47519781d8e5e454ce9d40652 (commit)
      from  f35ce0deffcc4eb7d804f1cd6436a7fa66372a0a (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 6848dcc371536fd47519781d8e5e454ce9d40652
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Dec 17 13:26:25 2018 -0800

    Pass by reference for cpp magic

diff --git a/src/algorithm/Length.cpp b/src/algorithm/Length.cpp
index dfb71cb..4d4ceb6 100644
--- a/src/algorithm/Length.cpp
+++ b/src/algorithm/Length.cpp
@@ -35,15 +35,14 @@ Length::ofLine(const geom::CoordinateSequence *pts)
 
     double len = 0.0;
 
-    geom::Coordinate p;
-    p = pts->getAt(0);
+    const geom::Coordinate &p = pts->getAt(0);
     double x0 = p.x;
     double y0 = p.y;
 
     for (size_t i = 1; i < n; i++) {
-        p = pts->getAt(i);
-        double x1 = p.x;
-        double y1 = p.y;
+        const geom::Coordinate &pi = pts->getAt(i);
+        double x1 = pi.x;
+        double y1 = pi.y;
         double dx = x1 - x0;
         double dy = y1 - y0;
 

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

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


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list