Skip to content
Permalink
Browse files

Fix some inefficient QString replace calls

  • Loading branch information
nyalldawson committed Nov 26, 2017
1 parent 148380a commit 718e4985c6eb90944ded415a1138ddc187f32121
@@ -1154,7 +1154,7 @@ QString QgsGdalProvider::generateBandName( int bandNumber ) const
val = values.at( 1 );
if ( values.at( 0 ) == QLatin1String( "NETCDF_DIM_EXTRA" ) )
{
dimExtraValues = val.replace( QStringLiteral( "{" ), QString() ).replace( QStringLiteral( "}" ), QString() ).split( ',' );
dimExtraValues = val.replace( '{', QString() ).replace( '}', QString() ).split( ',' );
//http://qt-project.org/doc/qt-4.8/qregexp.html#capturedTexts
}
else
@@ -81,7 +81,7 @@ QMap<QString, QString> QgsServerRequest::parameters() const
{
// prepare the value
QString value = pair.second;
value.replace( "+", " " );
value.replace( '+', ' ' );

mParams.insert( pair.first.toUpper(), value );
}
@@ -1298,7 +1298,7 @@ namespace QgsWfs
continue;
}

QDomElement fieldElem = doc.createElement( "qgs:" + attributeName.replace( QStringLiteral( " " ), QStringLiteral( "_" ) ) );
QDomElement fieldElem = doc.createElement( "qgs:" + attributeName.replace( ' ', '_' ) );
QDomText fieldText = doc.createTextNode( featureAttributes[idx].toString() );
fieldElem.appendChild( fieldText );
typeNameElement.appendChild( fieldElem );
@@ -1399,7 +1399,7 @@ namespace QgsWfs
continue;
}

QDomElement fieldElem = doc.createElement( "qgs:" + attributeName.replace( QStringLiteral( " " ), QStringLiteral( "_" ) ) );
QDomElement fieldElem = doc.createElement( "qgs:" + attributeName.replace( ' ', '_' ) );
QDomText fieldText = doc.createTextNode( featureAttributes[idx].toString() );
fieldElem.appendChild( fieldText );
typeNameElement.appendChild( fieldElem );
@@ -383,7 +383,7 @@ namespace QgsWfs

if ( !bbox.isEmpty() )
{
const QStringList corners = bbox.split( ',' );
QStringList corners = bbox.split( ',' );

if ( corners.size() == 4 )
{
@@ -933,7 +933,7 @@ namespace QgsWfs
}

// get bbox corners
const QStringList corners = bbox.split( ',' );
QStringList corners = bbox.split( ',' );
if ( corners.size() != 4 )
{
throw QgsRequestNotWellFormedException( QStringLiteral( "BBOX has to be composed of 4 elements: '%1'" ).arg( bbox ) );
@@ -916,7 +916,7 @@ namespace QgsWfs
}

// get bbox corners
const QStringList corners = bbox.split( ',' );
QStringList corners = bbox.split( ',' );
if ( corners.size() != 4 )
{
throw QgsRequestNotWellFormedException( QStringLiteral( "BBOX has to be composed of 4 elements: '%1'" ).arg( bbox ) );
@@ -2224,7 +2224,7 @@ namespace QgsWms
continue;
}

QDomElement fieldElem = doc.createElement( "qgs:" + attributeName.replace( QStringLiteral( " " ), QStringLiteral( "_" ) ) );
QDomElement fieldElem = doc.createElement( "qgs:" + attributeName.replace( ' ', '_' ) );
QString fieldTextString = featureAttributes.at( i ).toString();
if ( layer )
{

0 comments on commit 718e498

Please sign in to comment.
You can’t perform that action at this time.