summaryrefslogtreecommitdiff
path: root/indra/llcommon/llstringtable.cpp
diff options
context:
space:
mode:
authorFawrsk <fawrsk@gmail.com>2023-01-07 00:38:12 -0400
committerFawrsk <fawrsk@gmail.com>2023-01-07 00:38:12 -0400
commit9e743c99fb69db5694c388ae33656c62e3fa0b8e (patch)
treec981c998d0439d8bd48ce98123c19de8a9a27753 /indra/llcommon/llstringtable.cpp
parentd0f115ae093e8268da2a3245d6cb2f3bcc544f1c (diff)
Cleanup for loops in llcommon to use C++11 range based for loops
Diffstat (limited to 'indra/llcommon/llstringtable.cpp')
-rw-r--r--indra/llcommon/llstringtable.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/indra/llcommon/llstringtable.cpp b/indra/llcommon/llstringtable.cpp
index f288999964..92a5e777a6 100644
--- a/indra/llcommon/llstringtable.cpp
+++ b/indra/llcommon/llstringtable.cpp
@@ -89,9 +89,8 @@ LLStringTable::~LLStringTable()
{
if (mStringList[i])
{
- string_list_t::iterator iter;
- for (iter = mStringList[i]->begin(); iter != mStringList[i]->end(); iter++)
- delete *iter; // *iter = (LLStringTableEntry*)
+ for (LLStringTableEntry* entry : *mStringList[i])
+ delete entry;
}
delete mStringList[i];
}
@@ -156,9 +155,9 @@ LLStringTableEntry* LLStringTable::checkStringEntry(const char *str)
if (str)
{
char *ret_val;
- LLStringTableEntry *entry;
U32 hash_value = hash_my_string(str, mMaxEntries);
#if STRING_TABLE_HASH_MAP
+ LLStringTableEntry *entry;
#if 1 // Microsoft
string_hash_t::iterator lower = mStringHash.lower_bound(hash_value);
string_hash_t::iterator upper = mStringHash.upper_bound(hash_value);
@@ -180,10 +179,8 @@ LLStringTableEntry* LLStringTable::checkStringEntry(const char *str)
string_list_t *strlist = mStringList[hash_value];
if (strlist)
{
- string_list_t::iterator iter;
- for (iter = strlist->begin(); iter != strlist->end(); iter++)
+ for (LLStringTableEntry* entry : *strlist)
{
- entry = *iter;
ret_val = entry->mString;
if (!strncmp(ret_val, str, MAX_STRINGS_LENGTH))
{
@@ -226,9 +223,9 @@ LLStringTableEntry* LLStringTable::addStringEntry(const char *str)
if (str)
{
char *ret_val = NULL;
- LLStringTableEntry *entry;
U32 hash_value = hash_my_string(str, mMaxEntries);
#if STRING_TABLE_HASH_MAP
+ LLStringTableEntry *entry;
#if 1 // Microsoft
string_hash_t::iterator lower = mStringHash.lower_bound(hash_value);
string_hash_t::iterator upper = mStringHash.upper_bound(hash_value);
@@ -257,10 +254,8 @@ LLStringTableEntry* LLStringTable::addStringEntry(const char *str)
if (strlist)
{
- string_list_t::iterator iter;
- for (iter = strlist->begin(); iter != strlist->end(); iter++)
+ for (LLStringTableEntry* entry : *strlist)
{
- entry = *iter;
ret_val = entry->mString;
if (!strncmp(ret_val, str, MAX_STRINGS_LENGTH))
{
@@ -294,10 +289,10 @@ void LLStringTable::removeString(const char *str)
if (str)
{
char *ret_val;
- LLStringTableEntry *entry;
U32 hash_value = hash_my_string(str, mMaxEntries);
#if STRING_TABLE_HASH_MAP
{
+ LLStringTableEntry *entry;
#if 1 // Microsoft
string_hash_t::iterator lower = mStringHash.lower_bound(hash_value);
string_hash_t::iterator upper = mStringHash.upper_bound(hash_value);
@@ -331,10 +326,8 @@ void LLStringTable::removeString(const char *str)
if (strlist)
{
- string_list_t::iterator iter;
- for (iter = strlist->begin(); iter != strlist->end(); iter++)
+ for (LLStringTableEntry* entry : *strlist)
{
- entry = *iter;
ret_val = entry->mString;
if (!strncmp(ret_val, str, MAX_STRINGS_LENGTH))
{