summaryrefslogtreecommitdiff
path: root/indra/llxml
diff options
context:
space:
mode:
authorRye Mutt <rye@alchemyviewer.org>2024-07-01 22:25:56 -0400
committerRye Mutt <rye@alchemyviewer.org>2024-07-01 22:25:56 -0400
commitb0e30477e93bb16b0cf8c7b64aaee35cedf85ca8 (patch)
treed8e0c8eca6f078395d0bc581925f589adc67d895 /indra/llxml
parent49d60e0ded52c095c834e9ca134b67282728b389 (diff)
Use heterogeneous comparison for string_view map finds in LLControl and convert controlExists to string_view
Diffstat (limited to 'indra/llxml')
-rw-r--r--indra/llxml/llcontrol.cpp4
-rw-r--r--indra/llxml/llcontrol.h4
2 files changed, 4 insertions, 4 deletions
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<LLControlVariable> 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<LLControlVariable>() : 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<LLControlGroup, std::string>
LOG_CLASS(LLControlGroup);
protected:
- typedef std::map<std::string, LLControlVariablePtr > ctrl_name_table_t;
+ typedef std::map<std::string, LLControlVariablePtr, std::less<> > 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