From 76460e8c2c33af185ae8641775d5673fcdab0759 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Mon, 11 Mar 2024 22:45:36 -0700 Subject: Use LLCachedControl to speed up voice enable/disable checking --- indra/newview/llvoiceclient.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 44e00b69e5..b9b8742c41 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -569,7 +569,9 @@ void LLVoiceClient::setMicGain(F32 gain) bool LLVoiceClient::voiceEnabled() { - return gSavedSettings.getBOOL("EnableVoiceChat") && !gSavedSettings.getBOOL("CmdLineDisableVoice") && !gNonInteractive; + static LLCachedControl enable_voice_chat(gSavedSettings, "EnableVoiceChat"); + static LLCachedControl cmd_line_disable_voice(gSavedSettings, "CmdLineDisableVoice"); + return enable_voice_chat && !cmd_line_disable_voice && !gNonInteractive; } void LLVoiceClient::setVoiceEnabled(bool enabled) -- cgit v1.2.3