[geos-commits] [SCM] GEOS branch main updated. b541b57849a3148706ac2ce5f4a41453d50bde65

git at osgeo.org git at osgeo.org
Fri Oct 29 10:57:06 PDT 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, main has been updated
       via  b541b57849a3148706ac2ce5f4a41453d50bde65 (commit)
       via  15029298a3d64550439504083f48e2714fb17dec (commit)
      from  31deb41d81529756b9e47b9c8f2576849463b488 (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 b541b57849a3148706ac2ce5f4a41453d50bde65
Merge: 31deb41d8 15029298a
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Oct 29 10:55:32 2021 -0700

    Merge branch 'invert_unionSafe_conditions' of https://github.com/eyal0/geos into main


commit 15029298a3d64550439504083f48e2714fb17dec
Author: eyal0 <109809+eyal0 at users.noreply.github.com>
Date:   Thu Oct 28 21:06:38 2021 -0600

    Invert conditional in unionSafe()
    
    This prevents the compiler from mistakenly thinking that the
    dereferenced geometry is .  The compiler *should* have been able to
    figure this out and suppress the warning but it doesn't.
    
    This change shouldn't affect the functionality of the code.  It only
    gives a better hint to the compiler about the validity of the pointer
    to Geometry.

diff --git a/src/operation/union/CascadedPolygonUnion.cpp b/src/operation/union/CascadedPolygonUnion.cpp
index c30c6f7eb..1db99e630 100644
--- a/src/operation/union/CascadedPolygonUnion.cpp
+++ b/src/operation/union/CascadedPolygonUnion.cpp
@@ -120,18 +120,17 @@ CascadedPolygonUnion::binaryUnion(const std::vector<const geom::Geometry*> & geo
 std::unique_ptr<geom::Geometry>
 CascadedPolygonUnion::unionSafe(const geom::Geometry* g0, const geom::Geometry* g1) const
 {
-    if(g0 == nullptr && g1 == nullptr) {
-        return nullptr;
+    if(g0 != nullptr && g1 != nullptr) {
+        return unionActual(g0, g1);
     }
 
-    if(g0 == nullptr) {
+    if(g1 != nullptr) {
         return g1->clone();
     }
-    if(g1 == nullptr) {
+    if(g0 != nullptr) {
         return g0->clone();
     }
-
-    return unionActual(g0, g1);
+    return nullptr;
 }
 
 std::unique_ptr<geom::Geometry>

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

Summary of changes:
 src/operation/union/CascadedPolygonUnion.cpp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list