From 05dfa7bb98e424ed2ef1a69688f746d956eeddfd Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 20 Nov 2015 14:57:32 +0100 Subject: [PATCH] Small optimization: Don't always check the string length --- indra/newview/lfsimfeaturehandler.cpp | 13 +++++++++++-- indra/newview/lfsimfeaturehandler.h | 7 +++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/indra/newview/lfsimfeaturehandler.cpp b/indra/newview/lfsimfeaturehandler.cpp index 2748c139e9..1842426a82 100644 --- a/indra/newview/lfsimfeaturehandler.cpp +++ b/indra/newview/lfsimfeaturehandler.cpp @@ -20,12 +20,18 @@ #include "lfsimfeaturehandler.h" #include "llagent.h" +#include "lllogininstance.h" +#include "llviewercontrol.h" #include "llviewernetwork.h" #include "llviewerregion.h" -#include "llviewercontrol.h" -#include "lllogininstance.h" LFSimFeatureHandler::LFSimFeatureHandler() + : mSupportsExport(false), + mSayRange(20), + mShoutRange(100), + mWhisperRange(10), + mHasAvatarPicker(false), + mHasDestinationGuide(false) { LL_INFOS() << "Initializing Sim Feature Handler" << LL_ENDL; @@ -169,6 +175,9 @@ void LFSimFeatureHandler::setSupportedFeatures() mAvatarPickerURL = LLStringUtil::null; } } + + mHasAvatarPicker = !avatarPickerURL().empty(); + mHasDestinationGuide = !destinationGuideURL().empty(); } } diff --git a/indra/newview/lfsimfeaturehandler.h b/indra/newview/lfsimfeaturehandler.h index 88b89dae83..e69746ab7d 100644 --- a/indra/newview/lfsimfeaturehandler.h +++ b/indra/newview/lfsimfeaturehandler.h @@ -85,8 +85,8 @@ public: std::string avatarPickerURL() const { return mAvatarPickerURL; } std::string destinationGuideURL() const { return mDestinationGuideURL; } - bool hasAvatarPicker() const { return !avatarPickerURL().empty(); } - bool hasDestinationGuide() const { return !destinationGuideURL().empty(); } + bool hasAvatarPicker() const { return mHasAvatarPicker; } + bool hasDestinationGuide() const { return mHasDestinationGuide; } private: // SignaledTypes @@ -98,6 +98,9 @@ private: SignaledType mWhisperRange; SignaledType mAvatarPickerURL; SignaledType mDestinationGuideURL; + + bool mHasAvatarPicker; + bool mHasDestinationGuide; }; #endif //LFSIMFEATUREHANDLER_H