Skip to content
Snippets Groups Projects
Commit 589e8e7d authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Smol optimizations

parent 9e3ccf97
No related branches found
No related tags found
1 merge request!12Master
...@@ -1976,7 +1976,7 @@ void LLTextEditor::doDelete() ...@@ -1976,7 +1976,7 @@ void LLTextEditor::doDelete()
{ {
S32 i; S32 i;
S32 chars_to_remove = 1; S32 chars_to_remove = 1;
LLWString text = getWText(); const LLWString& text = getWText();
if( (text[ mCursorPos ] == ' ') && (mCursorPos + SPACES_PER_TAB < getLength()) ) if( (text[ mCursorPos ] == ' ') && (mCursorPos + SPACES_PER_TAB < getLength()) )
{ {
// Try to remove a full tab's worth of spaces // Try to remove a full tab's worth of spaces
...@@ -2580,7 +2580,7 @@ void LLTextEditor::updateLinkSegments() ...@@ -2580,7 +2580,7 @@ void LLTextEditor::updateLinkSegments()
{ {
if (!mParseHTML) return; if (!mParseHTML) return;
LLWString wtext = getWText(); const LLWString& wtext = getWText();
// update any segments that contain a link // update any segments that contain a link
for (const auto& mSegment : mSegments) for (const auto& mSegment : mSegments)
...@@ -2900,7 +2900,7 @@ BOOL LLTextEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect ...@@ -2900,7 +2900,7 @@ BOOL LLTextEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect
current_line++; current_line++;
} }
const LLWString textString(getWText()); const LLWString& textString = getWText();
const llwchar * const text = textString.c_str(); const llwchar * const text = textString.c_str();
const S32 line_height = mFont->getLineHeight(); const S32 line_height = mFont->getLineHeight();
......
...@@ -378,7 +378,7 @@ void LLView::removeChild(LLView* child) ...@@ -378,7 +378,7 @@ void LLView::removeChild(LLView* child)
llassert(!child->mInDraw); llassert(!child->mInDraw);
mChildList.remove( child ); 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) if(it->second == child)
{ {
......
...@@ -1043,7 +1043,7 @@ void LLViewerTextEditor::onValueChange(S32 start, S32 end) ...@@ -1043,7 +1043,7 @@ void LLViewerTextEditor::onValueChange(S32 start, S32 end)
void LLViewerTextEditor::findEmbeddedItemSegments(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 // Start with i just after the first embedded item
for(S32 idx = start; idx < end; idx++ ) for(S32 idx = start; idx < end; idx++ )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment