Skip to content

Commit

Permalink
Improve range-based for loop usage
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 8, 2020
1 parent 9118592 commit 03f070d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/providers/wms/qgswmssourceselect.cpp
Expand Up @@ -288,8 +288,8 @@ bool QgsWMSSourceSelect::populateLayerList( const QgsWmsCapabilities &capabiliti

bool first = true;
QSet<QString> alreadyAddedLabels;
const auto constSupportedImageEncodings = capabilities.supportedImageEncodings();
for ( const QString &encoding : constSupportedImageEncodings )
const auto supportedImageEncodings = capabilities.supportedImageEncodings();
for ( const QString &encoding : supportedImageEncodings )
{
int id = mMimeMap.value( encoding, -1 );
if ( id < 0 )
Expand Down Expand Up @@ -540,8 +540,7 @@ void QgsWMSSourceSelect::addButtonClicked()

const QgsWmtsTileLayer *layer = nullptr;

const auto constMTileLayers = mTileLayers;
for ( const QgsWmtsTileLayer &l : constMTileLayers )
for ( const QgsWmtsTileLayer &l : qgis::as_const( mTileLayers ) )
{
if ( l.identifier == layers.join( QStringLiteral( "," ) ) )
{
Expand Down Expand Up @@ -1032,7 +1031,7 @@ void QgsWMSSourceSelect::collectSelectedLayers( QStringList &layers, QStringList

void QgsWMSSourceSelect::collectDimensions( QStringList &layers, QgsDataSourceUri &uri )
{
for ( const QgsWmsLayerProperty layerProperty : mLayerProperties )
for ( const QgsWmsLayerProperty &layerProperty : qgis::as_const( mLayerProperties ) )
{
if ( layerProperty.name == layers.join( ',' ) )
{
Expand Down

0 comments on commit 03f070d

Please sign in to comment.