From 9e743c99fb69db5694c388ae33656c62e3fa0b8e Mon Sep 17 00:00:00 2001 From: Fawrsk Date: Sat, 7 Jan 2023 00:38:12 -0400 Subject: Cleanup for loops in llcommon to use C++11 range based for loops --- indra/llcommon/llnametable.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'indra/llcommon/llnametable.h') diff --git a/indra/llcommon/llnametable.h b/indra/llcommon/llnametable.h index d3283543f3..51247d61ba 100644 --- a/indra/llcommon/llnametable.h +++ b/indra/llcommon/llnametable.h @@ -86,12 +86,10 @@ public: // O(N)! (currently only used in one place... (newsim/llstate.cpp)) const char *resolveData(const DATA &data) const { - const_iter_t iter = mNameMap.begin(); - const_iter_t end = mNameMap.end(); - for (; iter != end; ++iter) + for (const name_map_t::value_type pair : mNameMap) { - if (iter->second == data) - return iter->first; + if (pair.second == data) + return pair.first; } return NULL; } -- cgit v1.2.3 From 8767e6995b0c9b9ed23e07f63d290a1da8c70f17 Mon Sep 17 00:00:00 2001 From: Fawrsk Date: Mon, 9 Jan 2023 19:19:12 -0400 Subject: Eliminate needless copies --- indra/llcommon/llnametable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llnametable.h') diff --git a/indra/llcommon/llnametable.h b/indra/llcommon/llnametable.h index 51247d61ba..2c8e71263e 100644 --- a/indra/llcommon/llnametable.h +++ b/indra/llcommon/llnametable.h @@ -86,7 +86,7 @@ public: // O(N)! (currently only used in one place... (newsim/llstate.cpp)) const char *resolveData(const DATA &data) const { - for (const name_map_t::value_type pair : mNameMap) + for (const name_map_t::value_type& pair : mNameMap) { if (pair.second == data) return pair.first; -- cgit v1.2.3