From 8cf01fce1ed625d1308b22928ce91bac6254e2a6 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Thu, 19 Mar 2020 14:58:35 -0400
Subject: [PATCH] Repeated dynamic_cast cleanup in LLFloater

---
 indra/llui/llfloater.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 39f65058d3a..fa13fd2264f 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1914,9 +1914,9 @@ void LLFloater::draw()
 	{
 		if (hasFocus() && getDefaultButton()->getEnabled())
 		{
-			LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
+			LLButton* focus_ctrl = dynamic_cast<LLButton*>(gFocusMgr.getKeyboardFocus());
 			// is this button a direct descendent and not a nested widget (e.g. checkbox)?
-			BOOL focus_is_child_button = dynamic_cast<LLButton*>(focus_ctrl) != NULL && dynamic_cast<LLButton*>(focus_ctrl)->getParent() == this;
+			BOOL focus_is_child_button = focus_ctrl != NULL && focus_ctrl->getParent() == this;
 			// only enable default button when current focus is not a button
 			getDefaultButton()->setBorderEnabled(!focus_is_child_button);
 		}
-- 
GitLab