From d0f115ae093e8268da2a3245d6cb2f3bcc544f1c Mon Sep 17 00:00:00 2001 From: Fawrsk Date: Thu, 5 Jan 2023 07:42:27 -0400 Subject: SL-18893 Cleanup for loops in llcharacter to use C++11 range based for loops (#42) --- indra/llcharacter/llgesture.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'indra/llcharacter/llgesture.cpp') diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp index 37904936d8..e9a4475707 100644 --- a/indra/llcharacter/llgesture.cpp +++ b/indra/llcharacter/llgesture.cpp @@ -199,15 +199,14 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin typedef boost::tokenizer > tokenizer; boost::char_separator sep(" "); tokenizer tokens(string, sep); - tokenizer::iterator token_iter; - for( token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) + for(std::string cur_token : tokens) { LLGesture* gesture = NULL; if( !found_gestures ) // Only pay attention to the first gesture in the string. { - std::string cur_token_lower = *token_iter; + std::string cur_token_lower = cur_token; LLStringUtil::toLower(cur_token_lower); for (U32 i = 0; i < mList.size(); i++) @@ -228,7 +227,7 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin LLStringUtil::toLower(output_lower); if( cur_token_lower == output_lower ) { - revised_string->append(*token_iter); + revised_string->append(cur_token); } else { @@ -249,7 +248,7 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin { revised_string->append( " " ); } - revised_string->append( *token_iter ); + revised_string->append( cur_token ); } first_token = FALSE; -- cgit v1.2.3 From 7419037ef6e8a5497283278baa8582b264d3aefa Mon Sep 17 00:00:00 2001 From: Fawrsk Date: Tue, 10 Jan 2023 05:43:27 -0400 Subject: SL-18893 Fixes for pull requests #38, #41, and #42 (#46) Eliminate unnecessary copies, and remove uses of auto --- indra/llcharacter/llgesture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcharacter/llgesture.cpp') diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp index e9a4475707..80717d8d26 100644 --- a/indra/llcharacter/llgesture.cpp +++ b/indra/llcharacter/llgesture.cpp @@ -200,7 +200,7 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin boost::char_separator sep(" "); tokenizer tokens(string, sep); - for(std::string cur_token : tokens) + for(const std::string& cur_token : tokens) { LLGesture* gesture = NULL; -- cgit v1.2.3