Prevent unnecessary string copies

master
Ansariel 2024-05-24 09:34:56 +02:00
parent 6e7e60b854
commit 0647597e8e
3 changed files with 6 additions and 5 deletions

View File

@ -456,6 +456,7 @@ template<class T> std::string LLStringUtilBase<T>::sLocale;
typedef LLStringUtilBase<char> LLStringUtil;
typedef LLStringUtilBase<llwchar> LLWStringUtil;
typedef std::basic_string<llwchar> LLWString;
typedef std::basic_string_view<llwchar> LLWStringView;
//@ Use this where we want to disallow input in the form of "foo"
// This is used to catch places where english text is embedded in the code

View File

@ -505,7 +505,7 @@ bool FSCommon::isFilterEditorKeyCombo(KEY key, MASK mask)
LLUUID FSCommon::getGroupForRezzing()
{
LLUUID group_id = gAgent.getGroupID();
LLUUID group_id{ gAgent.getGroupID() };
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (parcel && gSavedSettings.getBOOL("RezUnderLandGroup"))
@ -523,12 +523,12 @@ LLUUID FSCommon::getGroupForRezzing()
return group_id;
}
void FSCommon::updateUsedEmojis(LLWString text)
void FSCommon::updateUsedEmojis(LLWStringView text)
{
LLEmojiDictionary* dictionary = LLEmojiDictionary::getInstance();
bool emojiSent = false;
for (llwchar& c : text)
bool emojiSent{ false };
for (const llwchar& c : text)
{
if (dictionary->isEmoji(c))
{

View File

@ -94,7 +94,7 @@ namespace FSCommon
LLUUID getGroupForRezzing();
void updateUsedEmojis(LLWString text);
void updateUsedEmojis(LLWStringView text);
};
#endif // FS_COMMON_H