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

git at osgeo.org git at osgeo.org
Sat Dec 19 17:25:49 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  e8e20974f41963e4653fc6f20ac2e8ed0392f623 (commit)
       via  64d4caef9de566270925634816499dc2ce316dfa (commit)
      from  d111e8505e37839f95e3303ee7728a3236f72e07 (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 e8e20974f41963e4653fc6f20ac2e8ed0392f623
Author: Daniel Baston <dbaston at gmail.com>
Date:   Fri Nov 27 18:16:11 2020 -0500

    Inline Envelope::expandToInclude methods

diff --git a/include/geos/geom/Envelope.inl b/include/geos/geom/Envelope.inl
index 780213b..07ff498 100644
--- a/include/geos/geom/Envelope.inl
+++ b/include/geos/geom/Envelope.inl
@@ -75,6 +75,41 @@ Envelope::expandToInclude(const Coordinate& p)
     expandToInclude(p.x, p.y);
 }
 
+INLINE void
+Envelope::expandToInclude(const Envelope& other)
+{
+    return expandToInclude(&other);
+}
+
+/*public*/
+INLINE void
+Envelope::expandToInclude(const Envelope* other)
+{
+    if(other->isNull()) {
+        return;
+    }
+    if(isNull()) {
+        minx = other->getMinX();
+        maxx = other->getMaxX();
+        miny = other->getMinY();
+        maxy = other->getMaxY();
+    }
+    else {
+        if(other->minx < minx) {
+            minx = other->minx;
+        }
+        if(other->maxx > maxx) {
+            maxx = other->maxx;
+        }
+        if(other->miny < miny) {
+            miny = other->miny;
+        }
+        if(other->maxy > maxy) {
+            maxy = other->maxy;
+        }
+    }
+}
+
 /*public*/
 INLINE void
 Envelope::expandToInclude(double x, double y)
diff --git a/src/geom/Envelope.cpp b/src/geom/Envelope.cpp
index 986ab40..c821fd9 100644
--- a/src/geom/Envelope.cpp
+++ b/src/geom/Envelope.cpp
@@ -142,40 +142,6 @@ Envelope::init(Envelope env)
 }
 #endif // 0
 
-/*public*/
-void
-Envelope::expandToInclude(const Envelope* other)
-{
-    if(other->isNull()) {
-        return;
-    }
-    if(isNull()) {
-        minx = other->getMinX();
-        maxx = other->getMaxX();
-        miny = other->getMinY();
-        maxy = other->getMaxY();
-    }
-    else {
-        if(other->minx < minx) {
-            minx = other->minx;
-        }
-        if(other->maxx > maxx) {
-            maxx = other->maxx;
-        }
-        if(other->miny < miny) {
-            miny = other->miny;
-        }
-        if(other->maxy > maxy) {
-            maxy = other->maxy;
-        }
-    }
-}
-
-void
-Envelope::expandToInclude(const Envelope& other)
-{
-    return expandToInclude(&other);
-}
 
 /*public*/
 bool

commit 64d4caef9de566270925634816499dc2ce316dfa
Author: Daniel Baston <dbaston at gmail.com>
Date:   Fri Nov 27 17:37:18 2020 -0500

    Remove Envelope copy constructor / assignment operator
    
    No need to specify these explicitly; let compiler use its own
    implementation which may benefit from memcpy.

diff --git a/include/geos/geom/Envelope.h b/include/geos/geom/Envelope.h
index 5e73904..dd891ac 100644
--- a/include/geos/geom/Envelope.h
+++ b/include/geos/geom/Envelope.h
@@ -93,12 +93,6 @@ public:
      */
     Envelope(const Coordinate& p);
 
-    /// Copy constructor
-    Envelope(const Envelope& env);
-
-    /// Assignment operator
-    Envelope& operator=(const Envelope& e);
-
     /** \brief
      * Create an Envelope from an Envelope string representation produced
      * by Envelope::toString()
diff --git a/include/geos/geom/Envelope.inl b/include/geos/geom/Envelope.inl
index 73f32b3..780213b 100644
--- a/include/geos/geom/Envelope.inl
+++ b/include/geos/geom/Envelope.inl
@@ -60,21 +60,6 @@ Envelope::Envelope(const Coordinate& p)
 }
 
 /*public*/
-INLINE
-Envelope::Envelope(const Envelope& env)
-        :
-        minx(env.minx),
-        maxx(env.maxx),
-        miny(env.miny),
-        maxy(env.maxy)
-{
-#if GEOS_DEBUG
-    std::cerr << "Envelope copy" << std::endl;
-#endif
-    //init(env.minx, env.maxx, env.miny, env.maxy);
-}
-
-/*public*/
 INLINE double
 Envelope::distance(double x0, double y0, double x1, double y1)
 {
diff --git a/src/geom/Envelope.cpp b/src/geom/Envelope.cpp
index 5c615fb..986ab40 100644
--- a/src/geom/Envelope.cpp
+++ b/src/geom/Envelope.cpp
@@ -352,21 +352,6 @@ Envelope::expandBy(double deltaX, double deltaY)
     }
 }
 
-/*public*/
-Envelope&
-Envelope::operator=(const Envelope& e)
-{
-#if GEOS_DEBUG
-    std::cerr << "Envelope assignment" << std::endl;
-#endif
-    if(&e != this) {  // is this check useful ?
-        minx = e.minx;
-        maxx = e.maxx;
-        miny = e.miny;
-        maxy = e.maxy;
-    }
-    return *this;
-}
 
 
 } // namespace geos::geom

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

Summary of changes:
 include/geos/geom/Envelope.h   |  6 -----
 include/geos/geom/Envelope.inl | 50 +++++++++++++++++++++++++++++-------------
 src/geom/Envelope.cpp          | 49 -----------------------------------------
 3 files changed, 35 insertions(+), 70 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list