[geos-commits] [SCM] GEOS branch main updated. 220df45d361ebe658458f630baf117ab0bb31dd5

git at osgeo.org git at osgeo.org
Thu Aug 15 08:20:00 PDT 2024


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, main has been updated
       via  220df45d361ebe658458f630baf117ab0bb31dd5 (commit)
      from  5a2afd88a1e938f6ed6f42a675ec62152b0fdce9 (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 220df45d361ebe658458f630baf117ab0bb31dd5
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Aug 15 08:19:21 2024 -0700

    return reference instead of unique_ptr, per @dbaston

diff --git a/include/geos/geom/prep/BasicPreparedGeometry.h b/include/geos/geom/prep/BasicPreparedGeometry.h
index 068ade2bc..f061de451 100644
--- a/include/geos/geom/prep/BasicPreparedGeometry.h
+++ b/include/geos/geom/prep/BasicPreparedGeometry.h
@@ -61,12 +61,12 @@ private:
     std::vector<const CoordinateXY*> representativePts;
     mutable std::unique_ptr<RelateNG> relate_ng;
 
-    std::unique_ptr<RelateNG>& getRelateNG() const
+    RelateNG& getRelateNG() const
     {
         if (relate_ng == nullptr)
             relate_ng = RelateNG::prepare(baseGeom);
 
-        return relate_ng;
+        return *relate_ng;
     }
 
 protected:
diff --git a/src/geom/prep/BasicPreparedGeometry.cpp b/src/geom/prep/BasicPreparedGeometry.cpp
index c346fcf42..0718a37b0 100644
--- a/src/geom/prep/BasicPreparedGeometry.cpp
+++ b/src/geom/prep/BasicPreparedGeometry.cpp
@@ -93,73 +93,73 @@ BasicPreparedGeometry::isAnyTargetComponentInTest(const geom::Geometry* testGeom
 bool
 BasicPreparedGeometry::within(const geom::Geometry* g) const
 {
-    return getRelateNG()->within(g);
+    return getRelateNG().within(g);
 }
 
 bool
 BasicPreparedGeometry::contains(const geom::Geometry* g) const
 {
-    return getRelateNG()->contains(g);
+    return getRelateNG().contains(g);
 }
 
 bool
 BasicPreparedGeometry::containsProperly(const geom::Geometry* g)	const
 {
-    return getRelateNG()->relate(g, "T**FF*FF*");
+    return getRelateNG().relate(g, "T**FF*FF*");
 }
 
 bool
 BasicPreparedGeometry::coveredBy(const geom::Geometry* g) const
 {
-    return getRelateNG()->coveredBy(g);
+    return getRelateNG().coveredBy(g);
 }
 
 bool
 BasicPreparedGeometry::covers(const geom::Geometry* g) const
 {
-    return getRelateNG()->covers(g);
+    return getRelateNG().covers(g);
 }
 
 bool
 BasicPreparedGeometry::crosses(const geom::Geometry* g) const
 {
-    return getRelateNG()->crosses(g);
+    return getRelateNG().crosses(g);
 }
 
 bool
 BasicPreparedGeometry::disjoint(const geom::Geometry* g)	const
 {
-    return getRelateNG()->disjoint(g);
+    return getRelateNG().disjoint(g);
 }
 
 bool
 BasicPreparedGeometry::intersects(const geom::Geometry* g) const
 {
-    return getRelateNG()->intersects(g);
+    return getRelateNG().intersects(g);
 }
 
 bool
 BasicPreparedGeometry::overlaps(const geom::Geometry* g)	const
 {
-    return getRelateNG()->overlaps(g);
+    return getRelateNG().overlaps(g);
 }
 
 bool
 BasicPreparedGeometry::touches(const geom::Geometry* g) const
 {
-    return getRelateNG()->touches(g);
+    return getRelateNG().touches(g);
 }
 
 bool
 BasicPreparedGeometry::relate(const geom::Geometry* g, const std::string& pat) const
 {
-    return getRelateNG()->relate(g, pat);
+    return getRelateNG().relate(g, pat);
 }
 
 std::unique_ptr<IntersectionMatrix>
 BasicPreparedGeometry::relate(const geom::Geometry* g) const
 {
-    return getRelateNG()->relate(g);
+    return getRelateNG().relate(g);
 }
 
 

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

Summary of changes:
 include/geos/geom/prep/BasicPreparedGeometry.h |  4 ++--
 src/geom/prep/BasicPreparedGeometry.cpp        | 24 ++++++++++++------------
 2 files changed, 14 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list