Skip to content
Permalink
Browse files

Fix clazy qstring-left warnings

From the clazy docs:

Finds places where you're using QString::left(0) instead
of QString::at(0). The later form is cheaper.
  • Loading branch information
nyalldawson committed Oct 22, 2016
1 parent 368a04a commit 498d03b88afaa1460fd0839bc2787e7a9abb18b4
@@ -873,7 +873,7 @@ void QgsGrassModule::viewOutput()
bool onlyLayer1 = false;
for ( int j = 0; j < layers.count(); j++ )
{
if ( layers[j].left( 1 ) == "1" )
if ( layers[j].at( 0 ) == '1' )
{
onlyLayer1 = true;
break;
@@ -889,7 +889,7 @@ void QgsGrassModule::viewOutput()
+ map + "/" + layers[j];

// skip 0_* layers
if ( onlyLayer1 && layers[j].left( 1 ) != "1" )
if ( onlyLayer1 && layers[j].at( 0 ) != '1' )
continue;

QString name = QgsGrassUtils::vectorLayerName(
@@ -386,7 +386,7 @@ QgsGrassModuleOption::QgsGrassModuleOption( QgsGrassModule *module, QString key,
{
desc = val;
}
desc.replace( 0, 1, desc.left( 1 ).toUpper() );
desc.replace( 0, 1, desc.at( 0 ).toUpper() );

if ( mControlType == ComboBox )
{
@@ -373,7 +373,7 @@ void QgsGrassSelect::setLayers()
{
for ( int j = 0; j < layers.count(); j++ )
{
if ( layers[j].left( 1 ) == "1" )
if ( layers[j].at( 0 ) == '1' )
{
sel = j;
break;

0 comments on commit 498d03b

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