mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
refactor(dCommon): drop the unused wchar_t SplitString
wchar_t is 16-bit on Windows and 32-bit elsewhere; the game's wide strings are UTF-16 and already split through the char16_t overload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -237,23 +237,6 @@ bool GeneralUtils::ReplaceInString(std::string& str, const std::string_view from
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<std::wstring> GeneralUtils::SplitString(const std::wstring_view str, const wchar_t delimiter) {
|
||||
std::vector<std::wstring> vector = std::vector<std::wstring>();
|
||||
std::wstring current;
|
||||
|
||||
for (const wchar_t c : str) {
|
||||
if (c == delimiter) {
|
||||
vector.push_back(current);
|
||||
current = L"";
|
||||
} else {
|
||||
current += c;
|
||||
}
|
||||
}
|
||||
|
||||
vector.push_back(std::move(current));
|
||||
return vector;
|
||||
}
|
||||
|
||||
std::vector<std::u16string> GeneralUtils::SplitString(const std::u16string_view str, const char16_t delimiter) {
|
||||
std::vector<std::u16string> vector = std::vector<std::u16string>();
|
||||
std::u16string current;
|
||||
|
||||
@@ -145,8 +145,6 @@ namespace GeneralUtils {
|
||||
|
||||
std::u16string ReadWString(RakNet::BitStream& inStream);
|
||||
|
||||
std::vector<std::wstring> SplitString(const std::wstring_view str, const wchar_t delimiter);
|
||||
|
||||
std::vector<std::u16string> SplitString(const std::u16string_view str, const char16_t delimiter);
|
||||
|
||||
std::vector<std::string> SplitString(const std::string_view str, const char delimiter);
|
||||
|
||||
Reference in New Issue
Block a user