Fixed conversion of std::string to FString.

This commit is contained in:
Axel 2020-11-23 09:34:50 +01:00 committed by Axel1092
parent 6ad2610d33
commit 2fbae920b9
1 changed files with 3 additions and 9 deletions

View File

@ -48,16 +48,10 @@ namespace rpc {
// Slower conversion to fstring for long text // Slower conversion to fstring for long text
static inline FString ToLongFString(const std::string &str) { static inline FString ToLongFString(const std::string &str) {
FString result = ""; FString result = "";
size_t i = 0; for (size_t i = 0; i < str.size(); i++)
while(i + MaxStringLength < str.size()) { {
auto substr = str.substr(i, MaxStringLength); result += str[i];
FString temp_string(substr.size(), UTF8_TO_TCHAR(substr.c_str()));
result += temp_string;
i += MaxStringLength;
} }
auto substr = str.substr(i);
FString temp_string(substr.size(), UTF8_TO_TCHAR(substr.c_str()));
result += temp_string;
return result; return result;
} }