We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 2c00790 commit 1be40f5Copy full SHA for 1be40f5
src/core/geometry/qgsgeometrycollection.cpp
@@ -78,9 +78,19 @@ bool QgsGeometryCollection::operator==( const QgsAbstractGeometry &other ) const
78
79
for ( int i = 0; i < mGeometries.count(); ++i )
80
{
81
- if ( mGeometries.at( i ) != otherCollection->mGeometries.at( i )
82
- && mGeometries.at( i )->operator!=( *otherCollection->mGeometries.at( i ) ) )
83
- return false;
+ QgsAbstractGeometry *g1 = mGeometries.at( i );
+ QgsAbstractGeometry *g2 = otherCollection->mGeometries.at( i );
+
84
+ // Quick check if the geometries are exactly the same
85
+ if ( g1 != g2 )
86
+ {
87
+ if ( !g1 || !g2 )
88
+ return false;
89
90
+ // Slower check, compare the contents of the geometries
91
+ if ( *g1 != *g2 )
92
93
+ }
94
}
95
96
return true;
0 commit comments