Skip to content

Commit c179780

Browse files
committedSep 11, 2017
Use .empty() instead of .size() > 0/.size() >=1/etc
Possibly faster, and clearer to read
1 parent 2a33844 commit c179780

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+98
-96
lines changed
 

‎src/analysis/interpolation/qgsinterpolator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ QgsInterpolator::QgsInterpolator()
3737

3838
int QgsInterpolator::cacheBaseData()
3939
{
40-
if ( mLayerData.size() < 1 )
40+
if ( mLayerData.empty() )
4141
{
4242
return 0;
4343
}

‎src/analysis/openstreetmap/qgsosmimport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ bool QgsOSMXmlImport::createDatabase()
136136
{
137137
QString version = QString::fromUtf8( results[1] );
138138
QStringList parts = version.split( ' ', QString::SkipEmptyParts );
139-
if ( parts.size() >= 1 )
139+
if ( !parts.empty() )
140140
{
141141
QStringList verparts = parts[0].split( '.', QString::SkipEmptyParts );
142142
above41 = verparts.size() >= 2 && ( verparts[0].toInt() > 4 || ( verparts[0].toInt() == 4 && verparts[1].toInt() >= 1 ) );

0 commit comments

Comments
 (0)