summaryrefslogtreecommitdiff
path: root/indra/llcommon/llcallstack.cpp
diff options
context:
space:
mode:
authorakleshchev <117672381+akleshchev@users.noreply.github.com>2023-01-10 11:38:34 +0200
committerGitHub <noreply@github.com>2023-01-10 11:38:34 +0200
commit9c250f1a9ee2e49505a35513cb88de54e2694e6c (patch)
tree26c8c15b117bc183386af1ee6e8b6617708aeba7 /indra/llcommon/llcallstack.cpp
parentd0f115ae093e8268da2a3245d6cb2f3bcc544f1c (diff)
parent8767e6995b0c9b9ed23e07f63d290a1da8c70f17 (diff)
SL-18893 Cleanup for loops in llcommon to use C++11 range based for loops (#44)
* Cleanup for loops in llcommon to use C++11 range based for loops * Eliminate needless copies
Diffstat (limited to 'indra/llcommon/llcallstack.cpp')
-rw-r--r--indra/llcommon/llcallstack.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/indra/llcommon/llcallstack.cpp b/indra/llcommon/llcallstack.cpp
index 8db291eed1..83d5ae2a63 100644
--- a/indra/llcommon/llcallstack.cpp
+++ b/indra/llcommon/llcallstack.cpp
@@ -91,10 +91,9 @@ LLCallStack::LLCallStack(S32 skip_count, bool verbose):
bool LLCallStack::contains(const std::string& str)
{
- for (std::vector<std::string>::const_iterator it = m_strings.begin();
- it != m_strings.end(); ++it)
+ for (const std::string& src_str : m_strings)
{
- if (it->find(str) != std::string::npos)
+ if (src_str.find(str) != std::string::npos)
{
return true;
}
@@ -105,10 +104,9 @@ bool LLCallStack::contains(const std::string& str)
std::ostream& operator<<(std::ostream& s, const LLCallStack& call_stack)
{
#ifndef LL_RELEASE_FOR_DOWNLOAD
- std::vector<std::string>::const_iterator it;
- for (it=call_stack.m_strings.begin(); it!=call_stack.m_strings.end(); ++it)
+ for (const std::string& str : call_stack.m_strings)
{
- s << *it;
+ s << str;
}
#else
s << "UNAVAILABLE IN RELEASE";
@@ -156,9 +154,9 @@ bool LLContextStrings::contains(const std::string& str)
{
const std::map<std::string,S32>& strings =
LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->m_contextStrings;
- for (std::map<std::string,S32>::const_iterator it = strings.begin(); it!=strings.end(); ++it)
+ for (const std::map<std::string,S32>::value_type& str_pair : strings)
{
- if (it->first.find(str) != std::string::npos)
+ if (str_pair.first.find(str) != std::string::npos)
{
return true;
}
@@ -171,9 +169,9 @@ void LLContextStrings::output(std::ostream& os)
{
const std::map<std::string,S32>& strings =
LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->m_contextStrings;
- for (std::map<std::string,S32>::const_iterator it = strings.begin(); it!=strings.end(); ++it)
+ for (const std::map<std::string,S32>::value_type& str_pair : strings)
{
- os << it->first << "[" << it->second << "]" << "\n";
+ os << str_pair.first << "[" << str_pair.second << "]" << "\n";
}
}