Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Blottiere <blottiere.paul@gmail.com>
  • Loading branch information
domi4484 and pblottiere committed Apr 26, 2021
1 parent 1b10f18 commit 95e7360
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/core/settings/qgssettingsentry.cpp
Expand Up @@ -117,8 +117,8 @@ bool QgsSettingsEntryBase::keyIsValid( const QString &key ) const
if ( !hasDynamicKey() )
return completeKeyToCheck == prefixedSettingsKey;

QRegularExpression regularExpression( prefixedSettingsKey.replace( QRegularExpression( QStringLiteral( "%\\d+" ) ), QStringLiteral( ".*" ) ) );
QRegularExpressionMatch regularExpressionMatch = regularExpression.match( completeKeyToCheck );
const QRegularExpression regularExpression( prefixedSettingsKey.replace( QRegularExpression( QStringLiteral( "%\\d+" ) ), QStringLiteral( ".*" ) ) );
const QRegularExpressionMatch regularExpressionMatch = regularExpression.match( completeKeyToCheck );
return regularExpressionMatch.hasMatch();
}

Expand Down Expand Up @@ -643,4 +643,3 @@ int QgsSettingsEntryDouble::displayHintDecimals() const
}



2 changes: 1 addition & 1 deletion src/core/settings/qgssettingsregistry.cpp
Expand Up @@ -73,7 +73,7 @@ const QgsSettingsEntryBase *QgsSettingsRegistry::getSettingsEntry( const QString
for ( const QgsSettingsRegistry *settingsRegistry : std::as_const( mSettingsRegistryChildList ) )
{
const QgsSettingsEntryBase *settingsEntry = settingsRegistry->getSettingsEntry( key, true );
if ( settingsEntry != nullptr )
if ( settingsEntry )
return settingsEntry;
}
}
Expand Down

0 comments on commit 95e7360

Please sign in to comment.