summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llemojidictionary.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/indra/llui/llemojidictionary.cpp b/indra/llui/llemojidictionary.cpp
index bf7e53701d..e29f3436cf 100644
--- a/indra/llui/llemojidictionary.cpp
+++ b/indra/llui/llemojidictionary.cpp
@@ -192,6 +192,8 @@ void LLEmojiDictionary::findByShortCode(std::vector<LLEmojiSearchResult>& result
return false;
};
+ std::map<std::size_t, std::vector<LLEmojiSearchResult>> results;
+
for (const LLEmojiDescriptor& d : mEmojis)
{
if (d.ShortCodes.empty())
@@ -202,9 +204,18 @@ void LLEmojiDictionary::findByShortCode(std::vector<LLEmojiSearchResult>& result
std::size_t begin, end;
if (search(begin, end, shortCode))
{
- result.emplace_back(d.Character, shortCode, begin, end);
+ results[begin].emplace_back(d.Character, shortCode, begin, end);
}
}
+
+ for (const auto& it : results)
+ {
+#ifdef __cpp_lib_containers_ranges
+ result.append_range(it.second);
+#else
+ result.insert(result.end(), it.second.cbegin(), it.second.cend());
+#endif
+ }
}
const LLEmojiDescriptor* LLEmojiDictionary::getDescriptorFromEmoji(llwchar emoji) const