Skip to content

Commit

Permalink
Simplify and harden code for geometry collections
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Dec 15, 2015
1 parent e7a0167 commit b319435
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/core/geometry/qgsgeometrycollectionv2.cpp
Expand Up @@ -82,20 +82,12 @@ int QgsGeometryCollectionV2::numGeometries() const

const QgsAbstractGeometryV2* QgsGeometryCollectionV2::geometryN( int n ) const
{
if ( n >= mGeometries.size() )
{
return nullptr;
}
return mGeometries.at( n );
return mGeometries.value( n );
}

QgsAbstractGeometryV2* QgsGeometryCollectionV2::geometryN( int n )
{
if ( n < 0 || n >= mGeometries.size() )
{
return nullptr;
}
return mGeometries.at( n );
return mGeometries.value( n );
}

bool QgsGeometryCollectionV2::addGeometry( QgsAbstractGeometryV2* g )
Expand Down

0 comments on commit b319435

Please sign in to comment.