From 2a20ec5a94f6b4a91e655c5febcbe3daae7e23b6 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Wed, 30 Sep 2026 08:53:02 -0500 Subject: [PATCH] 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 --- dCommon/GeneralUtils.cpp | 17 ----------------- dCommon/GeneralUtils.h | 2 -- 2 files changed, 19 deletions(-) diff --git a/dCommon/GeneralUtils.cpp b/dCommon/GeneralUtils.cpp index 3185c4430..a11d991a9 100644 --- a/dCommon/GeneralUtils.cpp +++ b/dCommon/GeneralUtils.cpp @@ -237,23 +237,6 @@ bool GeneralUtils::ReplaceInString(std::string& str, const std::string_view from return true; } -std::vector GeneralUtils::SplitString(const std::wstring_view str, const wchar_t delimiter) { - std::vector vector = std::vector(); - 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 GeneralUtils::SplitString(const std::u16string_view str, const char16_t delimiter) { std::vector vector = std::vector(); std::u16string current; diff --git a/dCommon/GeneralUtils.h b/dCommon/GeneralUtils.h index ba5fc913b..3c2a6c950 100644 --- a/dCommon/GeneralUtils.h +++ b/dCommon/GeneralUtils.h @@ -145,8 +145,6 @@ namespace GeneralUtils { std::u16string ReadWString(RakNet::BitStream& inStream); - std::vector SplitString(const std::wstring_view str, const wchar_t delimiter); - std::vector SplitString(const std::u16string_view str, const char16_t delimiter); std::vector SplitString(const std::string_view str, const char delimiter);