[geos-commits] [SCM] GEOS branch master updated. 92beed319cc76c0b3bc1ca2b7e050f30620c4d3b

git at osgeo.org git at osgeo.org
Tue Jan 5 13:42:38 PST 2021


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  92beed319cc76c0b3bc1ca2b7e050f30620c4d3b (commit)
       via  dcff3b3dfbdf659c04642b3841896c1056c772dc (commit)
      from  203847a8ade193f3c1e2224b7b25828e3e67e746 (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 92beed319cc76c0b3bc1ca2b7e050f30620c4d3b
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Jan 5 13:32:46 2021 -0800

    Avoid one copy by emplacing insteading of pushing back new SegmentNodes

diff --git a/src/noding/SegmentNodeList.cpp b/src/noding/SegmentNodeList.cpp
index 739ecde..84c49dd 100644
--- a/src/noding/SegmentNodeList.cpp
+++ b/src/noding/SegmentNodeList.cpp
@@ -53,8 +53,8 @@ static Profiler* profiler = Profiler::instance();
 void
 SegmentNodeList::add(const Coordinate& intPt, std::size_t segmentIndex)
 {
-    SegmentNode sn(edge, intPt, segmentIndex, edge.getSegmentOctant(segmentIndex));
-    nodeMap.push_back(sn);
+    // SegmentNode sn(edge, intPt, segmentIndex, edge.getSegmentOctant(segmentIndex));
+    nodeMap.emplace_back(edge, intPt, segmentIndex, edge.getSegmentOctant(segmentIndex));
     ready = false;
 }
 

commit dcff3b3dfbdf659c04642b3841896c1056c772dc
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Jan 5 13:17:52 2021 -0800

    Make SegmentNode slightly smaller by removing unused pointer to parent NodedSegmentString

diff --git a/include/geos/noding/SegmentNode.h b/include/geos/noding/SegmentNode.h
index 3869475..2ab77a3 100644
--- a/include/geos/noding/SegmentNode.h
+++ b/include/geos/noding/SegmentNode.h
@@ -46,7 +46,7 @@ namespace noding { // geos.noding
  */
 class GEOS_DLL SegmentNode {
 private:
-    const NodedSegmentString* segString;
+    // const NodedSegmentString* segString;
 
     int segmentOctant;
 
diff --git a/src/noding/SegmentNode.cpp b/src/noding/SegmentNode.cpp
index 2a4a7f7..cc77ff8 100644
--- a/src/noding/SegmentNode.cpp
+++ b/src/noding/SegmentNode.cpp
@@ -39,16 +39,16 @@ namespace noding { // geos.noding
 SegmentNode::SegmentNode(const NodedSegmentString& ss, const geom::Coordinate& nCoord,
                          std::size_t nSegmentIndex, int nSegmentOctant)
         :
-        segString(&ss),
+        // segString(&ss),
         segmentOctant(nSegmentOctant),
         coord(nCoord),
         segmentIndex(nSegmentIndex)
 {
     // Number of points in NodedSegmentString is one-more number of segments
-    assert(segmentIndex < segString->size());
+    assert(segmentIndex < ss.size());
 
     isInteriorVar = \
-            !coord.equals2D(segString->getCoordinate(segmentIndex));
+            !coord.equals2D(ss.getCoordinate(segmentIndex));
 
 }
 

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

Summary of changes:
 include/geos/noding/SegmentNode.h | 2 +-
 src/noding/SegmentNode.cpp        | 6 +++---
 src/noding/SegmentNodeList.cpp    | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list