From 78f354925c1120bc51c7fc5b15a71c4e3bba9971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Liru=20F=C3=A6rs?= Date: Sun, 22 Dec 2019 18:35:59 -0500 Subject: [PATCH] Tiny refactor, harmless --- indra/newview/llfloatergroups.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 5367bcc6d..41e9b3fe0 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -375,7 +375,6 @@ LLSD create_group_element(const LLGroupData *group_datap, const LLUUID &active_g void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 powers_mask) { - S32 count = gAgent.mGroups.size(); LLUUID id; LLCtrlListInterface *group_list = ctrl->getListInterface(); if (!group_list) return; @@ -386,11 +385,13 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 pow group_list->operateOnAll(LLCtrlListInterface::OP_DELETE); - for(S32 i = 0; i < count; ++i) + for(const auto& group : gAgent.mGroups) { - LLSD element = create_group_element(&gAgent.mGroups[i], highlight_id, powers_mask); - if(element.size()) + LLSD element = create_group_element(&group, highlight_id, powers_mask); + if (element.size()) + { group_list->addElement(element, ADD_SORTED); + } } // add "none" to list at top