From 4ad357ec70e15afdfe78816990cb23c7ba17619c Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Mon, 1 Feb 2010 17:51:30 -0800 Subject: Fixes for EXT-4689 (Long-word chat spam cripples fps and/or disconnects client) Removed some unnecessary string copies in LLTextBase and LLNormalTextSegment by changing getWText() to return const LLWString& (instead of LLWString), and storing the result in a const LLWString& instead of an LLWString in places where the string doesn't need to be modified. Made LLTextViewModel::getDisplay() also return const LLWString& instead of LLWString. Removed a couple of unused local string variables in LLTextBase (the compiler flagged these after converting the local copies to const LLWString&). --- indra/llui/llviewmodel.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui/llviewmodel.h') diff --git a/indra/llui/llviewmodel.h b/indra/llui/llviewmodel.h index c8a9b52cca..992365d44d 100644 --- a/indra/llui/llviewmodel.h +++ b/indra/llui/llviewmodel.h @@ -107,7 +107,8 @@ public: // New functions /// Get the stored value in string form - LLWString getDisplay() const { return mDisplay; } + const LLWString& getDisplay() const { return mDisplay; } + /** * Set the display string directly (see LLTextEditor). What the user is * editing is actually the LLWString value rather than the underlying -- cgit v1.2.3