Updated logic to use AZStd::erase_if

Signed-off-by: Chris Galvan <chgalvan@amazon.com>
This commit is contained in:
Chris Galvan
2021-12-06 14:21:00 -06:00
parent e24323660b
commit 10e95cd863
@@ -3630,17 +3630,13 @@ namespace AzToolsFramework
// Do not create manipulators for any entities marked as read only
if (auto readOnlyEntityPublicInterface = AZ::Interface<ReadOnlyEntityPublicInterface>::Get())
{
for (auto it = m_selectedEntityIds.begin(); it != m_selectedEntityIds.end();)
{
if (readOnlyEntityPublicInterface->IsReadOnly(*it))
AZStd::erase_if(
m_selectedEntityIds,
[readOnlyEntityPublicInterface](auto entityId)
{
it = m_selectedEntityIds.erase(it);
return readOnlyEntityPublicInterface->IsReadOnly(entityId);
}
else
{
++it;
}
}
);
}
}