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:
@@ -333,7 +333,7 @@ TableData RifEclipseUserDataParserTools::tableDataFromText( std::stringstream& s
|
||||
else
|
||||
{
|
||||
std::vector<std::string> words = splitLineAndRemoveComments( firstLine );
|
||||
if ( words.size() > 0 )
|
||||
if ( !words.empty() )
|
||||
{
|
||||
allHeaderRows.push_back( words );
|
||||
}
|
||||
@@ -364,7 +364,7 @@ TableData RifEclipseUserDataParserTools::tableDataFromText( std::stringstream& s
|
||||
|
||||
if ( rowWords.size() == columnCount )
|
||||
{
|
||||
if ( unitNames.size() == 0 )
|
||||
if ( unitNames.empty() )
|
||||
{
|
||||
for ( const std::string& word : rowWords )
|
||||
{
|
||||
@@ -376,7 +376,7 @@ TableData RifEclipseUserDataParserTools::tableDataFromText( std::stringstream& s
|
||||
}
|
||||
}
|
||||
|
||||
if ( scaleFactors.size() == 0 )
|
||||
if ( scaleFactors.empty() )
|
||||
{
|
||||
std::vector<double> values;
|
||||
|
||||
@@ -408,7 +408,7 @@ TableData RifEclipseUserDataParserTools::tableDataFromText( std::stringstream& s
|
||||
std::vector<std::string> parserErrors;
|
||||
std::vector<std::vector<std::string>> tableHeaderText =
|
||||
RifEclipseUserDataKeywordTools::buildColumnHeaderText( quantityNames, headerRows, &parserErrors );
|
||||
if ( parserErrors.size() > 0 )
|
||||
if ( !parserErrors.empty() )
|
||||
{
|
||||
if ( errorText ) errorText->insert( errorText->end(), parserErrors.begin(), parserErrors.end() );
|
||||
|
||||
@@ -419,7 +419,7 @@ TableData RifEclipseUserDataParserTools::tableDataFromText( std::stringstream& s
|
||||
for ( size_t i = 0; i < tableHeaderText.size(); i++ )
|
||||
{
|
||||
auto columnText = tableHeaderText[i];
|
||||
if ( columnText.size() == 0 )
|
||||
if ( columnText.empty() )
|
||||
{
|
||||
if ( errorText ) errorText->push_back( "Detected column with no content" );
|
||||
continue;
|
||||
@@ -586,11 +586,11 @@ std::vector<std::vector<std::string>> RifEclipseUserDataParserTools::splitIntoCo
|
||||
{
|
||||
std::vector<std::vector<std::string>> headerLinesPerColumn;
|
||||
|
||||
if ( headerLines.size() > 0 )
|
||||
if ( !headerLines.empty() )
|
||||
{
|
||||
std::vector<size_t> columnOffsets = RifEclipseUserDataParserTools::columnIndexForWords( headerLines[0] );
|
||||
|
||||
if ( columnOffsets.size() > 0 )
|
||||
if ( !columnOffsets.empty() )
|
||||
{
|
||||
headerLinesPerColumn.resize( columnOffsets.size() );
|
||||
|
||||
@@ -655,7 +655,7 @@ std::vector<Column> RifEclipseUserDataParserTools::columnInfoFromColumnHeaders(
|
||||
|
||||
for ( auto columnLines : columnData )
|
||||
{
|
||||
if ( columnLines.size() == 0 ) continue;
|
||||
if ( columnLines.empty() ) continue;
|
||||
|
||||
std::string vectorName = columnLines[0];
|
||||
std::string unit;
|
||||
@@ -721,7 +721,7 @@ std::vector<TableData> RifEclipseUserDataParserTools::mergeEqualTimeSteps( const
|
||||
return tables;
|
||||
}
|
||||
|
||||
if ( tables[0].columnInfos().size() == 0 ) return tables;
|
||||
if ( tables[0].columnInfos().empty() ) return tables;
|
||||
|
||||
QDateTime firstTableStartTime;
|
||||
for ( auto c : tables[0].columnInfos() )
|
||||
@@ -771,7 +771,7 @@ std::vector<TableData> RifEclipseUserDataParserTools::mergeEqualTimeSteps( const
|
||||
}
|
||||
}
|
||||
|
||||
if ( tables[i].columnInfos().size() > 0 && tables[i].columnInfos()[0].itemCount() == itemsInFirstTable && isDatesEqual )
|
||||
if ( !tables[i].columnInfos().empty() && tables[i].columnInfos()[0].itemCount() == itemsInFirstTable && isDatesEqual )
|
||||
{
|
||||
for ( auto& c : tables[i].columnInfos() )
|
||||
{
|
||||
@@ -796,7 +796,7 @@ std::vector<TableData> RifEclipseUserDataParserTools::mergeEqualTimeSteps( const
|
||||
std::string RifEclipseUserDataParserTools::trimString( const std::string& s )
|
||||
{
|
||||
auto sCopy = s.substr( 0, s.find_last_not_of( ' ' ) + 1 );
|
||||
if ( sCopy.size() > 0 )
|
||||
if ( !sCopy.empty() )
|
||||
{
|
||||
sCopy = sCopy.substr( sCopy.find_first_not_of( ' ' ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user