Skip to content

Commit

Permalink
Remove keys().contains() anti pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Feb 25, 2021
1 parent edf31db commit 0665d61
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Expand Up @@ -294,7 +294,7 @@ bool QgsGeometryOverlapCheckError::handleChanges( const QgsGeometryCheck::Change
{
return false;
}
if ( changes.value( mOverlappedFeature.layerId() ).keys().contains( mOverlappedFeature.featureId() ) )
if ( changes.value( mOverlappedFeature.layerId() ).contains( mOverlappedFeature.featureId() ) )
{
return false;
}
Expand Down
Expand Up @@ -277,7 +277,7 @@ bool QgsGeometryCheckerResultTab::exportErrorsDo( const QString &file )
QgsGeometryCheckError *error = ui.tableWidgetErrors->item( row, 0 )->data( Qt::UserRole ).value<QgsGeometryCheckError *>();
QString layerName = QString();
const QString layerId = error->layerId();
if ( mChecker->featurePools().keys().contains( layerId ) )
if ( mChecker->featurePools().contains( layerId ) )
{
QgsVectorLayer *srcLayer = mChecker->featurePools()[layerId]->layer();
layerName = srcLayer->name();
Expand Down
2 changes: 1 addition & 1 deletion src/server/qgsserverogcapihandler.cpp
Expand Up @@ -477,7 +477,7 @@ QgsServerOgcApi::ContentType QgsServerOgcApiHandler::contentTypeFromRequest( con
{
// Check aliases
bool found { false };
if ( QgsServerOgcApi::contentTypeAliases().keys().contains( result ) )
if ( QgsServerOgcApi::contentTypeAliases().contains( result ) )
{
const QList<QgsServerOgcApi::ContentType> constCt { contentTypes() };
for ( const auto &ct : constCt )
Expand Down

0 comments on commit 0665d61

Please sign in to comment.