From b0e30477e93bb16b0cf8c7b64aaee35cedf85ca8 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 1 Jul 2024 22:25:56 -0400 Subject: Use heterogeneous comparison for string_view map finds in LLControl and convert controlExists to string_view --- indra/llxml/llcontrol.cpp | 4 ++-- indra/llxml/llcontrol.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llxml') diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 82e07e03c9..bb590ebd76 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -348,7 +348,7 @@ LLPointer LLControlGroup::getControl(std::string_view name) incrCount(name); } - ctrl_name_table_t::iterator iter = mNameTable.find(name.data()); + ctrl_name_table_t::iterator iter = mNameTable.find(name); return iter == mNameTable.end() ? LLPointer() : iter->second; } @@ -657,7 +657,7 @@ LLSD LLControlGroup::asLLSD(bool diffs_only) return result; } -bool LLControlGroup::controlExists(const std::string& name) +bool LLControlGroup::controlExists(std::string_view name) { ctrl_name_table_t::iterator iter = mNameTable.find(name); return iter != mNameTable.end(); diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index 1b04729a82..344352e980 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -189,7 +189,7 @@ class LLControlGroup : public LLInstanceTracker LOG_CLASS(LLControlGroup); protected: - typedef std::map ctrl_name_table_t; + typedef std::map > ctrl_name_table_t; ctrl_name_table_t mNameTable; static const std::string mTypeString[TYPE_COUNT]; @@ -295,7 +295,7 @@ public: } } - bool controlExists(const std::string& name); + bool controlExists(std::string_view name); // Returns number of controls loaded, 0 if failed // If require_declaration is false, will auto-declare controls it finds -- cgit v1.2.3