diff options
Diffstat (limited to 'indra/llcommon/llstringtable.cpp')
-rw-r--r-- | indra/llcommon/llstringtable.cpp | 23 |
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)) { |