summaryrefslogtreecommitdiff
path: root/indra/newview/tests/lldateutil_test.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-08-13 15:32:47 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-08-13 15:32:47 -0400
commit23f2631d598b6e07450a96ed1ec00670c8867cdd (patch)
tree20195c1688ad8cb7e8631c97fa5920624f10972c /indra/newview/tests/lldateutil_test.cpp
parent54334ff6e377e35c97df3a0fe2a859795ec07b21 (diff)
parent8ce3323269d95f54e2b768c4c5aa154d4afbbb6b (diff)
Merge branch 'develop' into nat/edu-channel
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)