#10649 ApplicationLibCode: Use collection.empty() instead of comparing with size

This commit is contained in:
Kristian Bendiksen
2023-09-27 08:07:49 +02:00
parent 98796b0dd9
commit 959c9d48fa
220 changed files with 432 additions and 431 deletions

View File

@@ -211,7 +211,7 @@ QList<caf::PdmOptionItemInfo> Rim3dWellLogFileCurve::calculateValueOptions( cons
}
}
if ( options.size() == 0 )
if ( options.empty() )
{
options.push_back( caf::PdmOptionItemInfo( "None", "None" ) );
}

View File

@@ -284,7 +284,7 @@ void RimEnsembleWellLogCurveSet::deleteEnsembleCurves()
}
}
while ( curvesIndexesToDelete.size() > 0 )
while ( !curvesIndexesToDelete.empty() )
{
size_t currIndex = curvesIndexesToDelete.back();
m_curves.erase( currIndex );
@@ -311,7 +311,7 @@ void RimEnsembleWellLogCurveSet::deleteStatisticsCurves()
}
}
while ( curvesIndexesToDelete.size() > 0 )
while ( !curvesIndexesToDelete.empty() )
{
size_t currIndex = curvesIndexesToDelete.back();
m_curves.erase( currIndex );
@@ -582,7 +582,7 @@ QList<caf::PdmOptionItemInfo> RimEnsembleWellLogCurveSet::calculateValueOptions(
}
}
if ( options.size() == 0 )
if ( options.empty() )
{
options.push_back( caf::PdmOptionItemInfo( "None", "None" ) );
}

View File

@@ -982,7 +982,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogExtractionCurve::calculateValueOptions(
QList<caf::PdmOptionItemInfo> options;
options = RimWellLogCurve::calculateValueOptions( fieldNeedingOptions );
if ( options.size() > 0 ) return options;
if ( !options.empty() ) return options;
if ( fieldNeedingOptions == &m_wellPath )
{

View File

@@ -352,7 +352,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogFileCurve::calculateValueOptions( const
QList<caf::PdmOptionItemInfo> options;
options = RimWellLogCurve::calculateValueOptions( fieldNeedingOptions );
if ( options.size() > 0 ) return options;
if ( !options.empty() ) return options;
if ( fieldNeedingOptions == &m_wellPath )
{
@@ -362,13 +362,13 @@ QList<caf::PdmOptionItemInfo> RimWellLogFileCurve::calculateValueOptions( const
for ( auto wellPath : wellPathColl->allWellPaths() )
{
// Only include well paths coming from a well log file
if ( wellPath->wellLogFiles().size() > 0 )
if ( !wellPath->wellLogFiles().empty() )
{
options.push_back( caf::PdmOptionItemInfo( wellPath->name(), wellPath ) );
}
}
if ( options.size() > 0 )
if ( !options.empty() )
{
options.push_front( caf::PdmOptionItemInfo( "None", nullptr ) );
}
@@ -391,7 +391,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogFileCurve::calculateValueOptions( const
}
}
if ( options.size() == 0 )
if ( options.empty() )
{
options.push_back( caf::PdmOptionItemInfo( "None", "None" ) );
}
@@ -399,7 +399,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogFileCurve::calculateValueOptions( const
if ( fieldNeedingOptions == &m_wellLogFile )
{
if ( m_wellPath() && m_wellPath->wellLogFiles().size() > 0 )
if ( m_wellPath() && !m_wellPath->wellLogFiles().empty() )
{
for ( RimWellLogFile* const wellLogFile : m_wellPath->wellLogFiles() )
{

View File

@@ -2571,7 +2571,7 @@ RigEclipseWellLogExtractor* RimWellLogTrack::createSimWellExtractor( RimWellLogP
std::vector<const RigWellPath*> wellPaths = RiaSimWellBranchTools::simulationWellBranches( simWellName, useBranchDetection );
if ( wellPaths.size() == 0 ) return nullptr;
if ( wellPaths.empty() ) return nullptr;
CVF_ASSERT( branchIndex >= 0 && branchIndex < static_cast<int>( wellPaths.size() ) );