Small optimization: Don't always check the string length

master
Ansariel 2015-11-20 14:57:32 +01:00
parent b75792767e
commit 05dfa7bb98
2 changed files with 16 additions and 4 deletions

View File

@ -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();
}
}

View File

@ -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<U32> mWhisperRange;
SignaledType<std::string> mAvatarPickerURL;
SignaledType<std::string> mDestinationGuideURL;
bool mHasAvatarPicker;
bool mHasDestinationGuide;
};
#endif //LFSIMFEATUREHANDLER_H