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/llregistry.h | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'indra/llcommon/llregistry.h') diff --git a/indra/llcommon/llregistry.h b/indra/llcommon/llregistry.h index 750fe9fdc8..e272d7a9b8 100644 --- a/indra/llcommon/llregistry.h +++ b/indra/llcommon/llregistry.h @@ -141,11 +141,9 @@ public: ptr_value_t getValue(ref_const_key_t key) { - for(scope_list_iterator_t it = mActiveScopes.begin(); - it != mActiveScopes.end(); - ++it) + for(Registrar* scope : mActiveScopes) { - ptr_value_t valuep = (*it)->getValue(key); + ptr_value_t valuep = scope->getValue(key); if (valuep != NULL) return valuep; } return mDefaultRegistrar.getValue(key); @@ -153,11 +151,9 @@ public: ptr_const_value_t getValue(ref_const_key_t key) const { - for(scope_list_const_iterator_t it = mActiveScopes.begin(); - it != mActiveScopes.end(); - ++it) + for(const Registrar* scope : mActiveScopes) { - ptr_value_t valuep = (*it)->getValue(key); + ptr_const_value_t valuep = scope->getValue(key); if (valuep != NULL) return valuep; } return mDefaultRegistrar.getValue(key); @@ -165,11 +161,9 @@ public: bool exists(ref_const_key_t key) const { - for(scope_list_const_iterator_t it = mActiveScopes.begin(); - it != mActiveScopes.end(); - ++it) + for(const Registrar* scope : mActiveScopes) { - if ((*it)->exists(key)) return true; + if (scope->exists(key)) return true; } return mDefaultRegistrar.exists(key); @@ -177,11 +171,9 @@ public: bool empty() const { - for(scope_list_const_iterator_t it = mActiveScopes.begin(); - it != mActiveScopes.end(); - ++it) + for(const Registrar* scope : mActiveScopes) { - if (!(*it)->empty()) return false; + if (!scope->empty()) return false; } return mDefaultRegistrar.empty(); -- cgit v1.2.3