From e1d32346961e44a007ac1e4501588fa4dc886be1 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Sat, 20 Mar 2021 01:25:24 -0400
Subject: [PATCH] Fix slow code in LLError

---
 indra/llcommon/llerror.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index 71716f5ba1c..8de17fdb3a2 100644
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -1452,13 +1452,14 @@ namespace LLError
 			return;
 		}
 
-		if(strlen(out->str().c_str()) < 128)
+		auto out_str = out->str();
+		if(out_str.size() < 128)
 		{
-			strcpy(message, out->str().c_str());
+			strcpy(message, out_str.c_str());
 		}
 		else
 		{
-			strncpy(message, out->str().c_str(), 127);
+			strncpy(message, out_str.c_str(), 127);
 			message[127] = '\0' ;
 		}
 
-- 
GitLab