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:
@@ -136,7 +136,7 @@ void RimAsciiDataCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
auto plot = firstAncestorOrThisOfType<RimSummaryPlot>();
|
||||
bool useLogarithmicScale = plot->isLogarithmicScaleEnabled( yAxis() );
|
||||
|
||||
if ( dateTimes.size() > 0 && dateTimes.size() == values.size() )
|
||||
if ( !dateTimes.empty() && dateTimes.size() == values.size() )
|
||||
{
|
||||
if ( plot->timeAxisProperties()->timeMode() == RimSummaryTimeAxisProperties::DATE )
|
||||
{
|
||||
@@ -147,7 +147,7 @@ void RimAsciiDataCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
double timeScale = plot->timeAxisProperties()->fromTimeTToDisplayUnitScale();
|
||||
|
||||
std::vector<double> times;
|
||||
if ( dateTimes.size() )
|
||||
if ( !dateTimes.empty() )
|
||||
{
|
||||
time_t startDate = dateTimes[0];
|
||||
for ( time_t& date : dateTimes )
|
||||
|
||||
@@ -178,7 +178,7 @@ void RimDerivedSummaryCase::calculate( const RifEclipseSummaryAddress& address )
|
||||
|
||||
// Check if we got any data. If not, erase the map entry to comply with previous behavior
|
||||
|
||||
if ( !itAndIsInsertedPair.first->second.first.size() )
|
||||
if ( itAndIsInsertedPair.first->second.first.empty() )
|
||||
{
|
||||
m_dataCache.erase( itAndIsInsertedPair.first );
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ void RimEnsembleCurveFilter::fieldChangedByUi( const caf::PdmFieldHandle* change
|
||||
}
|
||||
else if ( changedField == &m_filterMode )
|
||||
{
|
||||
if ( m_objectiveValuesSummaryAddresses.size() == 0 )
|
||||
if ( m_objectiveValuesSummaryAddresses.empty() )
|
||||
{
|
||||
RimSummaryAddress* summaryAddress = new RimSummaryAddress();
|
||||
|
||||
|
||||
@@ -503,7 +503,7 @@ void RimEnsembleCurveSet::deleteEnsembleCurves()
|
||||
curvesIndexesToDelete.push_back( c );
|
||||
}
|
||||
|
||||
while ( curvesIndexesToDelete.size() > 0 )
|
||||
while ( !curvesIndexesToDelete.empty() )
|
||||
{
|
||||
size_t currIndex = curvesIndexesToDelete.back();
|
||||
delete m_curves[currIndex];
|
||||
@@ -525,7 +525,7 @@ void RimEnsembleCurveSet::deleteStatisticsCurves()
|
||||
curvesIndexesToDelete.push_back( c );
|
||||
}
|
||||
|
||||
while ( curvesIndexesToDelete.size() > 0 )
|
||||
while ( !curvesIndexesToDelete.empty() )
|
||||
{
|
||||
size_t currIndex = curvesIndexesToDelete.back();
|
||||
delete m_curves[currIndex];
|
||||
@@ -808,7 +808,7 @@ void RimEnsembleCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
||||
|
||||
if ( m_colorMode() == ColorMode::BY_OBJECTIVE_FUNCTION || m_colorMode == ColorMode::BY_CUSTOM_OBJECTIVE_FUNCTION )
|
||||
{
|
||||
if ( m_objectiveValuesSummaryAddresses.size() == 0 )
|
||||
if ( m_objectiveValuesSummaryAddresses.empty() )
|
||||
{
|
||||
RimSummaryAddress* summaryAddress = new RimSummaryAddress();
|
||||
summaryAddress->setAddress( m_yValuesSummaryAddress->address() );
|
||||
|
||||
@@ -155,7 +155,7 @@ double RimObjectiveFunction::value( RimSummaryCase*
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_normalizeByNumberOfVectors && vectorSummaryAddresses.size() > 0 )
|
||||
if ( m_normalizeByNumberOfVectors && !vectorSummaryAddresses.empty() )
|
||||
{
|
||||
aggregatedObjectiveFunctionValue /= vectorSummaryAddresses.size();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user