#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

@@ -39,7 +39,7 @@ bool RicReloadWellPathFormationNamesFeature::isCommandEnabled() const
std::vector<RimWellPathCollection*> wellPathCollection;
caf::SelectionManager::instance()->objectsByType( &wellPathCollection );
return ( wellPaths.size() > 0 || wellPathCollection.size() > 0 );
return ( !wellPaths.empty() || !wellPathCollection.empty() );
}
//--------------------------------------------------------------------------------------------------
@@ -53,12 +53,12 @@ void RicReloadWellPathFormationNamesFeature::onActionTriggered( bool isChecked )
std::vector<RimWellPathCollection*> wellPathCollections;
caf::SelectionManager::instance()->objectsByType( &wellPathCollections );
if ( wellPaths.size() > 0 )
if ( !wellPaths.empty() )
{
RimWellPathCollection* wellPathCollection = wellPaths[0]->firstAncestorOrThisOfTypeAsserted<RimWellPathCollection>();
wellPathCollection->reloadAllWellPathFormations();
}
else if ( wellPathCollections.size() > 0 )
else if ( !wellPathCollections.empty() )
{
wellPathCollections[0]->reloadAllWellPathFormations();
}