From d0511cf444aa8451442865e1387888880701b120 Mon Sep 17 00:00:00 2001 From: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> Date: Fri, 3 Dec 2021 10:31:40 -0800 Subject: [PATCH] Fix warnings on Mac builds. (#6112) * Fix warnings on Mac builds. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Save one map query Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> --- .../Entity/ReadOnly/ReadOnlyEntitySystemComponent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/ReadOnly/ReadOnlyEntitySystemComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/ReadOnly/ReadOnlyEntitySystemComponent.cpp index f7f36177c9..7536e1e8a5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/ReadOnly/ReadOnlyEntitySystemComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/ReadOnly/ReadOnlyEntitySystemComponent.cpp @@ -52,7 +52,7 @@ namespace AzToolsFramework void ReadOnlyEntitySystemComponent::RefreshReadOnlyState(const EntityIdList& entityIds) { - for (const AZ::EntityId entityId : entityIds) + for (const AZ::EntityId& entityId : entityIds) { bool wasReadOnly = m_readOnlystates[entityId]; QueryReadOnlyStateForEntity(entityId); @@ -67,10 +67,10 @@ namespace AzToolsFramework void ReadOnlyEntitySystemComponent::RefreshReadOnlyStateForAllEntities() { - for (auto elem : m_readOnlystates) + for (auto& elem : m_readOnlystates) { AZ::EntityId entityId = elem.first; - bool wasReadOnly = m_readOnlystates[entityId]; + bool wasReadOnly = elem.second; QueryReadOnlyStateForEntity(entityId); if (bool isReadOnly = m_readOnlystates[entityId]; wasReadOnly != isReadOnly)