#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

@@ -53,7 +53,7 @@ bool RicPasteEclipseCasesFeature::isCommandEnabled() const
std::vector<caf::PdmPointer<RimEclipseResultCase>> typedObjects;
objectGroup.objectsByType( &typedObjects );
if ( typedObjects.size() == 0 )
if ( typedObjects.empty() )
{
return false;
}
@@ -77,7 +77,7 @@ void RicPasteEclipseCasesFeature::onActionTriggered( bool isChecked )
caf::PdmObjectGroup objectGroup;
RicPasteFeatureImpl::findObjectsFromClipboardRefs( &objectGroup );
if ( objectGroup.objects.size() == 0 ) return;
if ( objectGroup.objects.empty() ) return;
addCasesToGridCaseGroup( objectGroup, gridCaseGroup );
@@ -115,7 +115,7 @@ void RicPasteEclipseCasesFeature::addCasesToGridCaseGroup( caf::PdmObjectGroup&
}
}
if ( resultCases.size() == 0 )
if ( resultCases.empty() )
{
return;
}

View File

@@ -46,7 +46,7 @@ bool RicPasteGeoMechViewsFeature::isCommandEnabled() const
std::vector<caf::PdmPointer<RimGeoMechView>> typedObjects;
objectGroup.objectsByType( &typedObjects );
if ( typedObjects.size() == 0 )
if ( typedObjects.empty() )
{
return false;
}
@@ -70,7 +70,7 @@ void RicPasteGeoMechViewsFeature::onActionTriggered( bool isChecked )
caf::PdmObjectGroup objectGroup;
RicPasteFeatureImpl::findObjectsFromClipboardRefs( &objectGroup );
if ( objectGroup.objects.size() == 0 ) return;
if ( objectGroup.objects.empty() ) return;
std::vector<caf::PdmPointer<RimGeoMechView>> geomViews;
objectGroup.objectsByType( &geomViews );

View File

@@ -71,7 +71,7 @@ void RicPasteIntersectionsFeature::onActionTriggered( bool isChecked )
caf::PdmObjectGroup objectGroup;
RicPasteFeatureImpl::findObjectsFromClipboardRefs( &objectGroup );
if ( objectGroup.objects.size() == 0 ) return;
if ( objectGroup.objects.empty() ) return;
std::vector<caf::PdmPointer<RimExtrudedCurveIntersection>> intersectionObjects;
objectGroup.objectsByType( &intersectionObjects );