Skip to content

Commit 498d03b

Browse files
committed
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.
1 parent 368a04a commit 498d03b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/plugins/grass/qgsgrassmodule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ void QgsGrassModule::viewOutput()
873873
bool onlyLayer1 = false;
874874
for ( int j = 0; j < layers.count(); j++ )
875875
{
876-
if ( layers[j].left( 1 ) == "1" )
876+
if ( layers[j].at( 0 ) == '1' )
877877
{
878878
onlyLayer1 = true;
879879
break;
@@ -889,7 +889,7 @@ void QgsGrassModule::viewOutput()
889889
+ map + "/" + layers[j];
890890

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

895895
QString name = QgsGrassUtils::vectorLayerName(

src/plugins/grass/qgsgrassmoduleparam.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ QgsGrassModuleOption::QgsGrassModuleOption( QgsGrassModule *module, QString key,
386386
{
387387
desc = val;
388388
}
389-
desc.replace( 0, 1, desc.left( 1 ).toUpper() );
389+
desc.replace( 0, 1, desc.at( 0 ).toUpper() );
390390

391391
if ( mControlType == ComboBox )
392392
{

src/plugins/grass/qgsgrassselect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ void QgsGrassSelect::setLayers()
373373
{
374374
for ( int j = 0; j < layers.count(); j++ )
375375
{
376-
if ( layers[j].left( 1 ) == "1" )
376+
if ( layers[j].at( 0 ) == '1' )
377377
{
378378
sel = j;
379379
break;

0 commit comments

Comments
 (0)