Skip to content

Commit f380577

Browse files
committedSep 24, 2018
Micro-optimisation: don't call geos for checking point geometry validity
Since a single-point will always be valid
1 parent 93f83a0 commit f380577

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/core/geometry/qgsgeometry.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,6 +2365,12 @@ bool QgsGeometry::isGeosValid() const
23652365
return false;
23662366
}
23672367

2368+
// avoid calling geos for trivial point geometries
2369+
if ( QgsWkbTypes::flatType( d->geometry->wkbType() ) == QgsWkbTypes::Point )
2370+
{
2371+
return true;
2372+
}
2373+
23682374
QgsGeos geos( d->geometry.get() );
23692375
mLastError.clear();
23702376
return geos.isValid( &mLastError );

0 commit comments

Comments
 (0)
Please sign in to comment.