mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#10649 Fwk: Use collection.empty() instead of comparing with size
This commit is contained in:
@@ -48,7 +48,7 @@ namespace caf
|
||||
ColorTable::ColorTable( const std::vector<cvf::Color3ub>& colors )
|
||||
: m_colors( colors )
|
||||
{
|
||||
CVF_ASSERT( m_colors.size() > 0 );
|
||||
CVF_ASSERT( !m_colors.empty() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -57,7 +57,7 @@ ColorTable::ColorTable( const std::vector<cvf::Color3ub>& colors )
|
||||
ColorTable::ColorTable( const cvf::Color3ubArray& colors )
|
||||
: m_colors( colors.begin(), colors.end() )
|
||||
{
|
||||
CVF_ASSERT( m_colors.size() > 0 );
|
||||
CVF_ASSERT( !m_colors.empty() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -190,12 +190,12 @@ bool Utils::getSaveDirectoryAndCheckOverwriteFiles( const QString& defaultDir, s
|
||||
}
|
||||
}
|
||||
|
||||
if ( filesToOverwrite.size() == 0 )
|
||||
if ( filesToOverwrite.empty() )
|
||||
{
|
||||
overWriteFiles = true;
|
||||
return overWriteFiles;
|
||||
}
|
||||
else if ( filesToOverwrite.size() > 0 )
|
||||
else if ( !filesToOverwrite.empty() )
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ void CellRangeFilter::addCellExclude( size_t i, size_t j, size_t k, bool applyTo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool CellRangeFilter::isCellVisible( size_t i, size_t j, size_t k, bool isInSubGridArea ) const
|
||||
{
|
||||
if ( m_includeRanges.size() == 0 )
|
||||
if ( m_includeRanges.empty() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ bool CellRangeFilter::isCellExcluded( size_t i, size_t j, size_t k, bool isInSub
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool CellRangeFilter::hasIncludeRanges() const
|
||||
{
|
||||
if ( m_includeRanges.size() > 0 )
|
||||
if ( !m_includeRanges.empty() )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
@@ -411,7 +411,7 @@ void StructGridGeometryGenerator::computeArrays()
|
||||
if ( isCellFaceVisible( i, j, k, StructGridInterface::POS_K ) )
|
||||
visibleFaces.push_back( cvf::StructGridInterface::POS_K );
|
||||
|
||||
if ( visibleFaces.size() > 0 )
|
||||
if ( !visibleFaces.empty() )
|
||||
{
|
||||
cvf::Vec3d cornerVerts[8];
|
||||
m_grid->cellCornerVertices( cellIndex, cornerVerts );
|
||||
|
||||
Reference in New Issue
Block a user