From 2a5e90a8585128c62bc3db7898bf81b96a571c9e Mon Sep 17 00:00:00 2001 From: Cinders Date: Tue, 12 Nov 2013 14:59:08 -0700 Subject: [PATCH] Cache routinely hit AFKTimeout setting --- indra/newview/llappviewer.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a80b92c403..f10882f0af 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -533,12 +533,16 @@ void idle_afk_check() // [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g #ifdef RLV_EXTENSION_CMD_ALLOWIDLE // Enforce an idle time of 30 minutes if @allowidle=n restricted - F32 afk_timeout = (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) ? gSavedSettings.getS32("AFKTimeout") : 60 * 30; + // Cache frequently hit location + static LLCachedControl sAFKTimeout(gSavedSettings, "AFKTimeout"); + S32 afk_timeout = (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) ? sAFKTimeout : 60 * 30; #else - F32 afk_timeout = gSavedSettings.getS32("AFKTimeout"); + static LLCachedControl afk_timeout(gSavedSettings, "AFKTimeout"); // #endif // RLV_EXTENSION_CMD_ALLOWIDLE // [/RLVa:KB] - if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK()) + // Explicit conversions just cos. + //if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK()) + if (static_cast(afk_timeout) && (current_idle > static_cast(afk_timeout)) && ! gAgent.getAFK()) { LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL; gAgent.setAFK(); @@ -943,7 +947,7 @@ bool LLAppViewer::init() // QAModeTermCode set, terminate with that rc on LL_ERRS. Use _exit() // rather than exit() because normal cleanup depends too much on // successful startup! - LLError::setFatalFunction(boost::bind(_exit, rc)); + //LLError::setFatalFunction(boost::bind(_exit, rc)); } mAlloc.setProfilingEnabled(gSavedSettings.getBOOL("MemProfiling"));