[geos-commits] [SCM] GEOS branch master updated. 76d7586ea53b2f9796bd4257d1d997fe05f11703

git at osgeo.org git at osgeo.org
Thu Nov 5 01:38:07 PST 2020


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  76d7586ea53b2f9796bd4257d1d997fe05f11703 (commit)
      from  6841d68152f296ce3007af5b4789f2d9b25f0f25 (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 76d7586ea53b2f9796bd4257d1d997fe05f11703
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Wed Nov 4 14:28:47 2020 -0800

    Remove no-op code from QESubdiv::remove

diff --git a/include/geos/triangulate/quadedge/QuadEdgeSubdivision.h b/include/geos/triangulate/quadedge/QuadEdgeSubdivision.h
index e3b5c88..f5852f9 100644
--- a/include/geos/triangulate/quadedge/QuadEdgeSubdivision.h
+++ b/include/geos/triangulate/quadedge/QuadEdgeSubdivision.h
@@ -93,6 +93,10 @@ public:
                                  const QuadEdge* triEdge[3]);
 
 private:
+    /**
+     * Use a deque to ensure QuadEdge pointers are stable.
+     * Note that it is NOT safe to erase entries from the deque.
+     */
     std::deque<QuadEdgeQuartet> quadEdges;
     std::array<QuadEdge*, 3> startingEdges;
     double tolerance;
diff --git a/src/triangulate/quadedge/QuadEdgeSubdivision.cpp b/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
index 14c07fa..bc0a019 100644
--- a/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
+++ b/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
@@ -128,17 +128,10 @@ QuadEdgeSubdivision::remove(QuadEdge& e)
     QuadEdge::splice(e, e.oPrev());
     QuadEdge::splice(e.sym(), e.sym().oPrev());
 
-    // this is inefficient but this should be called infrequently
-    // check base edge against both edge and sym, since either may be removed
-    // rot edges do not need to be tested because they are not removed
-    quadEdges.erase(
-            std::remove_if(quadEdges.begin(), quadEdges.end(),
-                           [e](QuadEdgeQuartet& es) {
-                               return &es.base() == &e || &es.base() == &e.sym(); }),
-            quadEdges.end());
-    //mark these edges as removed
-    e.remove();
+    // because QuadEdge pointers must be stable, do not remove edge from quadedges container
+    // This is fine since they are detached from the subdivision
 
+    e.remove();
 }
 
 QuadEdge*

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

Summary of changes:
 include/geos/triangulate/quadedge/QuadEdgeSubdivision.h |  4 ++++
 src/triangulate/quadedge/QuadEdgeSubdivision.cpp        | 13 +++----------
 2 files changed, 7 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list