Skip to content

Commit

Permalink
Use .at(0) instead of .left(1), as it avoids string allocation
Browse files Browse the repository at this point in the history
Thanks to Clazy
  • Loading branch information
nyalldawson committed Aug 29, 2017
1 parent cca964a commit 7e9428f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/wfs/qgswfsprovider.cpp
Expand Up @@ -1363,7 +1363,7 @@ bool QgsWFSProvider::readAttributesFromSchema( QDomDocument &schemaDoc,
geometryAttribute = ref.mid( 4 ); // Strip gml: prefix geometryAttribute = ref.mid( 4 ); // Strip gml: prefix
QString propertyType( gmlRefProperty.cap( 1 ) ); QString propertyType( gmlRefProperty.cap( 1 ) );
// Set the first character in upper case // Set the first character in upper case
propertyType = propertyType.left( 1 ).toUpper() + propertyType.mid( 1 ); propertyType = propertyType.at( 0 ).toUpper() + propertyType.mid( 1 );
geomType = geomTypeFromPropertyType( geometryAttribute, propertyType ); geomType = geomTypeFromPropertyType( geometryAttribute, propertyType );
} }
else if ( !name.isEmpty() ) //todo: distinguish between numerical and non-numerical types else if ( !name.isEmpty() ) //todo: distinguish between numerical and non-numerical types
Expand Down

0 comments on commit 7e9428f

Please sign in to comment.