From 6b1dfa588da52db16e10453d1e40a6988cc3afb1 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Wed, 18 Mar 2020 08:25:16 -0400 Subject: [PATCH] Smol opts --- indra/newview/llfloaterimsession.cpp | 8 +++----- indra/newview/llimview.cpp | 23 +++++++---------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index b1319d9c100..81afd5bf758 100644 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -1085,12 +1085,10 @@ void LLFloaterIMSession::processAgentListUpdates(const LLSD& body) if (body.isMap() && body.has("agent_updates") && body["agent_updates"].isMap()) { LLSD::map_const_iterator update_it; - for(update_it = body["agent_updates"].beginMap(); - update_it != body["agent_updates"].endMap(); - ++update_it) + for(const auto& agent_update : body["agent_updates"].map()) { - LLUUID agent_id(update_it->first); - LLSD agent_data = update_it->second; + LLUUID agent_id(agent_update.first); + LLSD agent_data = agent_update.second; if (agent_data.isMap()) { diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 4ea73ea4d95..4b156d505fd 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3226,19 +3226,13 @@ void LLIMMgr::addPendingAgentListUpdates( update_types.append("agent_updates"); update_types.append("updates"); - for ( - array_iter = update_types.beginArray(); - array_iter != update_types.endArray(); - ++array_iter) + for (const auto& update_type : update_types.array()) { //we only want to include the last update for a given agent - for ( - iter = updates[array_iter->asString()].beginMap(); - iter != updates[array_iter->asString()].endMap(); - ++iter) + for (const auto& update_pair : updates[update_type.asStringRef()].map()) { - mPendingAgentListUpdates[session_id.asString()][array_iter->asString()][iter->first] = - iter->second; + mPendingAgentListUpdates[session_id.asString()][array_iter->asString()][update_pair.first] = + update_pair.second; } } } @@ -3250,13 +3244,10 @@ void LLIMMgr::addPendingAgentListUpdates( //of agent_id -> "LEAVE"/"ENTER" //only want to keep last update for each agent - for ( - iter = updates["updates"].beginMap(); - iter != updates["updates"].endMap(); - ++iter) + for (const auto& update_pair : updates["updates"].map()) { - mPendingAgentListUpdates[session_id.asString()]["updates"][iter->first] = - iter->second; + mPendingAgentListUpdates[session_id.asString()]["updates"][update_pair.first] = + update_pair.second; } } } -- GitLab