From 719923fd7e765dea824d8b0a0d6facc7343221ad Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Wed, 19 Feb 2020 19:40:16 -0500
Subject: [PATCH] Cache parcel overlay color lookup in statics

---
 indra/newview/llviewerparceloverlay.cpp | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index 6e63b1449b..2f1e7b35ce 100644
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -340,12 +340,12 @@ void LLViewerParcelOverlay::updateOverlayTexture()
 	{
 		return;
 	}
-	const LLColor4U avail = LLUIColorTable::instance().getColor("PropertyColorAvail").get();
-	const LLColor4U owned = LLUIColorTable::instance().getColor("PropertyColorOther").get();
-	const LLColor4U group = LLUIColorTable::instance().getColor("PropertyColorGroup").get();
-	const LLColor4U self  = LLUIColorTable::instance().getColor("PropertyColorSelf").get();
-	const LLColor4U for_sale  = LLUIColorTable::instance().getColor("PropertyColorForSale").get();
-	const LLColor4U auction  = LLUIColorTable::instance().getColor("PropertyColorAuction").get();
+	static const LLColor4U avail = LLUIColorTable::instance().getColor("PropertyColorAvail").get();
+	static const LLColor4U owned = LLUIColorTable::instance().getColor("PropertyColorOther").get();
+	static const LLColor4U group = LLUIColorTable::instance().getColor("PropertyColorGroup").get();
+	static const LLColor4U self  = LLUIColorTable::instance().getColor("PropertyColorSelf").get();
+	static const LLColor4U for_sale  = LLUIColorTable::instance().getColor("PropertyColorForSale").get();
+	static const LLColor4U auction  = LLUIColorTable::instance().getColor("PropertyColorAuction").get();
 
 	// Create the base texture.
 	U8 *raw = mImageRaw->getData();
@@ -454,11 +454,11 @@ void LLViewerParcelOverlay::updatePropertyLines()
 	
 	S32 row, col;
 
-	const LLColor4U self_coloru  = LLUIColorTable::instance().getColor("PropertyColorSelf").get();
-	const LLColor4U other_coloru = LLUIColorTable::instance().getColor("PropertyColorOther").get();
-	const LLColor4U group_coloru = LLUIColorTable::instance().getColor("PropertyColorGroup").get();
-	const LLColor4U for_sale_coloru = LLUIColorTable::instance().getColor("PropertyColorForSale").get();
-	const LLColor4U auction_coloru = LLUIColorTable::instance().getColor("PropertyColorAuction").get();
+	static const LLColor4U self_coloru  = LLUIColorTable::instance().getColor("PropertyColorSelf").get();
+	static const LLColor4U other_coloru = LLUIColorTable::instance().getColor("PropertyColorOther").get();
+	static const LLColor4U group_coloru = LLUIColorTable::instance().getColor("PropertyColorGroup").get();
+	static const LLColor4U for_sale_coloru = LLUIColorTable::instance().getColor("PropertyColorForSale").get();
+	static const LLColor4U auction_coloru = LLUIColorTable::instance().getColor("PropertyColorAuction").get();
 
 	// Build into dynamic arrays, then copy into static arrays.
 	std::vector<LLVector3> new_vertex_array;
-- 
GitLab