Fix some inefficient QString replace calls

This commit is contained in:
Nyall Dawson 2017-11-26 12:48:00 +10:00
parent 148380abef
commit 718e4985c6
7 changed files with 8 additions and 8 deletions

View File

@ -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

View File

@ -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 );
}

View File

@ -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 );

View File

@ -383,7 +383,7 @@ namespace QgsWfs
if ( !bbox.isEmpty() )
{
const QStringList corners = bbox.split( ',' );
QStringList corners = bbox.split( ',' );
if ( corners.size() == 4 )
{

View File

@ -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 ) );

View File

@ -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 ) );

View File

@ -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 )
{