[geos-commits] [SCM] GEOS branch master updated. bd66c5a7e69a474454d63c66a11358472038289e

git at osgeo.org git at osgeo.org
Mon Sep 9 09:22:58 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  bd66c5a7e69a474454d63c66a11358472038289e (commit)
      from  26ccaf42ee19df2ff2f4164a1a7d7a5237e93140 (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 bd66c5a7e69a474454d63c66a11358472038289e
Author: Daniel Baston <dbaston at gmail.com>
Date:   Mon Sep 9 12:22:13 2019 -0400

    Avoid unnecessary sort in SubgraphDepthLocater
    
    Patch by dkvash
    Fixes #985

diff --git a/src/operation/buffer/SubgraphDepthLocater.cpp b/src/operation/buffer/SubgraphDepthLocater.cpp
index 94d06e4..9c8ec42 100644
--- a/src/operation/buffer/SubgraphDepthLocater.cpp
+++ b/src/operation/buffer/SubgraphDepthLocater.cpp
@@ -163,9 +163,8 @@ SubgraphDepthLocater::getDepth(const Coordinate& p)
         return 0;
     }
 
-    sort(stabbedSegments.begin(), stabbedSegments.end(), DepthSegmentLessThen());
-
-    DepthSegment* ds = stabbedSegments[0];
+    DepthSegment *ds = *std::min_element(stabbedSegments.begin(),
+        stabbedSegments.end(), DepthSegmentLessThen());
     int ret = ds->leftDepth;
 
 #if GEOS_DEBUG

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

Summary of changes:
 src/operation/buffer/SubgraphDepthLocater.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list