summaryrefslogtreecommitdiff
path: root/indra/newview/tests/lldateutil_test.cpp
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2024-08-09 17:57:23 -0700
committerBrad Linden <brad@lindenlab.com>2024-08-09 17:57:23 -0700
commita7fde9d79c517bfc6165756c1bc3eb16fa4d935c (patch)
treef0608f7f72f23a447778f8bce6f210eb221ebdf1 /indra/newview/tests/lldateutil_test.cpp
parentac330f63fd7ac655bbd06ce5d4ed65430aa2f42a (diff)
parentc106221726c48a4231b7854bff224ae422c0517f (diff)
Merge remote-tracking branch release/2024.06-atlasaurus into 'develop'
Diffstat (limited to 'indra/newview/tests/lldateutil_test.cpp')
-rw-r--r--indra/newview/tests/lldateutil_test.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/indra/newview/tests/lldateutil_test.cpp b/indra/newview/tests/lldateutil_test.cpp
index e9d4982e35..151aadfd4b 100644
--- a/indra/newview/tests/lldateutil_test.cpp
+++ b/indra/newview/tests/lldateutil_test.cpp
@@ -38,18 +38,23 @@
// Baked-in return values for getString()
-std::map< std::string, std::string > gString;
+std::map< std::string, std::string, std::less<>> gString;
// Baked-in return values for getCountString()
// map of pairs of input xml_desc and integer count
typedef std::pair< std::string, int > count_string_t;
std::map< count_string_t, std::string > gCountString;
-std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string)
+std::string LLTrans::getString(const std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string)
{
- std::string text = gString[xml_desc];
- LLStringUtil::format(text, args);
- return text;
+ auto it = gString.find(xml_desc);
+ if (it != gString.end())
+ {
+ std::string text = it->second;
+ LLStringUtil::format(text, args);
+ return text;
+ }
+ return {};
}
std::string LLTrans::getCountString(const std::string& language, const std::string& xml_desc, S32 count)