From 589e8e7d44ced17e85f818182ebb68621133777f Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Wed, 26 Feb 2020 02:55:12 -0500
Subject: [PATCH] Smol optimizations

---
 indra/llui/lltexteditor.cpp          | 6 +++---
 indra/llui/llview.cpp                | 2 +-
 indra/newview/llviewertexteditor.cpp | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 3cb912ee12..c8f86bb5af 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -1976,7 +1976,7 @@ void LLTextEditor::doDelete()
 	{	
 		S32 i;
 		S32 chars_to_remove = 1;
-		LLWString text = getWText();
+		const LLWString& text = getWText();
 		if( (text[ mCursorPos ] == ' ') && (mCursorPos + SPACES_PER_TAB < getLength()) )
 		{
 			// Try to remove a full tab's worth of spaces
@@ -2580,7 +2580,7 @@ void LLTextEditor::updateLinkSegments()
 {
 	if (!mParseHTML) return;
 
-	LLWString wtext = getWText();
+	const LLWString& wtext = getWText();
 
 	// update any segments that contain a link
 	for (const auto& mSegment : mSegments)
@@ -2900,7 +2900,7 @@ BOOL LLTextEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect
 		current_line++;
 	}
 
-    const LLWString textString(getWText());
+    const LLWString& textString = getWText();
 	const llwchar * const text = textString.c_str();
 	const S32 line_height = mFont->getLineHeight();
 
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 6b75cb17ac..ceb4f08327 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -378,7 +378,7 @@ void LLView::removeChild(LLView* child)
 		llassert(!child->mInDraw);
 		mChildList.remove( child );
 
-		for(auto it=mChildHashMap.begin(); it != mChildHashMap.end(); ++it)
+		for(auto it=mChildHashMap.begin(), end = mChildHashMap.end(); it != end; ++it)
 		{
 			if(it->second == child)
 			{
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index df042bedd3..3e7f7a3ab0 100644
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -1043,7 +1043,7 @@ void LLViewerTextEditor::onValueChange(S32 start, S32 end)
 
 void LLViewerTextEditor::findEmbeddedItemSegments(S32 start, S32 end)
 {
-	LLWString text = getWText();
+	const LLWString& text = getWText();
 
 	// Start with i just after the first embedded item
 	for(S32 idx = start; idx < end; idx++ )
-- 
GitLab