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/llheteromap.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llcommon/llheteromap.cpp') diff --git a/indra/llcommon/llheteromap.cpp b/indra/llcommon/llheteromap.cpp index 7c19196e0c..4bc29a1736 100644 --- a/indra/llcommon/llheteromap.cpp +++ b/indra/llcommon/llheteromap.cpp @@ -22,11 +22,11 @@ LLHeteroMap::~LLHeteroMap() { // For each entry in our map, we must call its deleter, which is the only // record we have of its original type. - for (TypeMap::iterator mi(mMap.begin()), me(mMap.end()); mi != me; ++mi) + for (TypeMap::value_type pair : mMap) { - // mi->second is the std::pair; mi->second.first is the void*; - // mi->second.second points to the deleter function - (mi->second.second)(mi->second.first); - mi->second.first = NULL; + // pair.second is the std::pair; pair.second.first is the void*; + // pair.second.second points to the deleter function + (pair.second.second)(pair.second.first); + pair.second.first = 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/llheteromap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llheteromap.cpp') diff --git a/indra/llcommon/llheteromap.cpp b/indra/llcommon/llheteromap.cpp index 4bc29a1736..c84e49d085 100644 --- a/indra/llcommon/llheteromap.cpp +++ b/indra/llcommon/llheteromap.cpp @@ -22,7 +22,7 @@ LLHeteroMap::~LLHeteroMap() { // For each entry in our map, we must call its deleter, which is the only // record we have of its original type. - for (TypeMap::value_type pair : mMap) + for (TypeMap::value_type& pair : mMap) { // pair.second is the std::pair; pair.second.first is the void*; // pair.second.second points to the deleter function -- cgit v1.2.3