From a6f87722e96c40c4926d2bc63527d3bc7a36a586 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Sat, 17 Oct 2020 19:13:30 -0400 Subject: [PATCH] Various small cleanups and optimization --- indra/llui/llchat.h | 4 ++-- indra/llui/llfolderviewitem.cpp | 3 +-- indra/llui/lltrans.cpp | 2 +- indra/llui/lltrans.h | 2 +- indra/llui/llurlentry.cpp | 2 +- indra/newview/llinspect.cpp | 4 ++-- indra/newview/llviewertexturelist.cpp | 2 +- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/indra/llui/llchat.h b/indra/llui/llchat.h index 746103b9115..a422b64e525 100644 --- a/indra/llui/llchat.h +++ b/indra/llui/llchat.h @@ -71,8 +71,8 @@ typedef enum e_chat_style class LLChat { public: - LLChat(const std::string& text = std::string()) - : mText(text), + LLChat(std::string text = std::string()) + : mText(std::move(text)), mFromName(), mFromID(), mNotifId(), diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 999c50376be..91cdef420ac 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -494,8 +494,7 @@ void LLFolderViewItem::rename(const std::string& new_name) const std::string& LLFolderViewItem::getName( void ) const { - static const std::string noName(""); - return getViewModelItem() ? getViewModelItem()->getName() : noName; + return getViewModelItem() ? getViewModelItem()->getName() : LLStringUtil::null; } // LLView functionality diff --git a/indra/llui/lltrans.cpp b/indra/llui/lltrans.cpp index 1fb48181f17..8ac3ca0df36 100644 --- a/indra/llui/lltrans.cpp +++ b/indra/llui/lltrans.cpp @@ -344,7 +344,7 @@ std::string LLTrans::getCountString(const std::string_view language, const std:: return getString(key, args); } -void LLTrans::setDefaultArg(const std::string& name, const std::string value) +void LLTrans::setDefaultArg(const std::string& name, std::string value) { sDefaultArgs[name] = std::move(value); } diff --git a/indra/llui/lltrans.h b/indra/llui/lltrans.h index 329189a3585..16c690fad9e 100644 --- a/indra/llui/lltrans.h +++ b/indra/llui/lltrans.h @@ -117,7 +117,7 @@ class LLTrans return sDefaultArgs; } - static void setDefaultArg(const std::string& name, const std::string value); + static void setDefaultArg(const std::string& name, std::string value); // insert default args into an arg list static void getArgs(LLStringUtil::format_map_t& args) diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 8b1b401b71e..b1a197ec6cd 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -176,7 +176,7 @@ void LLUrlEntryBase::callObservers(const std::string &id, bool LLUrlEntryBase::isLinkDisabled() const { // this allows us to have a global setting to turn off text hyperlink highlighting/action - static LLCachedControl<bool> globally_disabled(*LLUI::getInstance()->mSettingGroups["config"], "DisableTextHyperlinkActions", false); + static LLUICachedControl<bool> globally_disabled("DisableTextHyperlinkActions", false); return globally_disabled; } diff --git a/indra/newview/llinspect.cpp b/indra/newview/llinspect.cpp index d9e91ad5ed1..a7e21b10a77 100644 --- a/indra/newview/llinspect.cpp +++ b/indra/newview/llinspect.cpp @@ -45,8 +45,8 @@ LLInspect::~LLInspect() // virtual void LLInspect::draw() { - static LLCachedControl<F32> FADE_TIME(*LLUI::getInstance()->mSettingGroups["config"], "InspectorFadeTime", 1.f); - static LLCachedControl<F32> STAY_TIME(*LLUI::getInstance()->mSettingGroups["config"], "InspectorShowTime", 1.f); + static LLUICachedControl<F32> FADE_TIME("InspectorFadeTime", 1.f); + static LLUICachedControl<F32> STAY_TIME("InspectorShowTime", 1.f); if (mOpenTimer.getStarted()) { LLFloater::draw(); diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 5a59894709f..5a7f28abe0d 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1736,7 +1736,7 @@ LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const st // Don't add downloadable content into this list // all UI images are non-deletable and list does not support deletion imagep->setNoDelete(); - mUIImages.insert(std::make_pair(name, new_imagep)); + mUIImages.emplace(name, new_imagep); mUITextureList.push_back(imagep); } -- GitLab