mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#10649 ApplicationLibCode: Use collection.empty() instead of comparing with size
This commit is contained in:
@@ -211,7 +211,7 @@ QList<caf::PdmOptionItemInfo> Rim3dWellLogFileCurve::calculateValueOptions( cons
|
||||
}
|
||||
}
|
||||
|
||||
if ( options.size() == 0 )
|
||||
if ( options.empty() )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( "None", "None" ) );
|
||||
}
|
||||
|
||||
@@ -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" ) );
|
||||
}
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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() )
|
||||
{
|
||||
|
||||
@@ -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() ) );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user