Skip to content

Commit

Permalink
Fix clazy qstring-left warnings
Browse files Browse the repository at this point in the history
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 498d03b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/plugins/grass/qgsgrassmodule.cpp
Expand Up @@ -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;
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassmoduleparam.cpp
Expand Up @@ -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 )
{
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassselect.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 498d03b

Please sign in to comment.