From 5f906736863f35a7018aaa11a7cac408229c21cf Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Sun, 22 Sep 2024 00:24:21 -0700 Subject: StringUtil: Remove `JoinStrings` With 12 uses of `JoinStrings` in the codebase vs 36 uses of `fmt::join`, fmtlib's range adapter for string concatenation with delimiters is clearly the preferred option. --- Source/Core/Common/StringUtil.cpp | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'Source/Core/Common/StringUtil.cpp') diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index 513a880cd7..7fc4af83b6 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -368,21 +368,6 @@ std::vector SplitString(const std::string& str, const char delim) return output; } -std::string JoinStrings(const std::vector& strings, const std::string& delimiter) -{ - // Check if we can return early, just for speed - if (strings.empty()) - return ""; - - std::ostringstream res; - std::copy(strings.begin(), strings.end(), - std::ostream_iterator(res, delimiter.c_str())); - - // Drop the trailing delimiter. - std::string joined = res.str(); - return joined.substr(0, joined.length() - delimiter.length()); -} - std::string TabsToSpaces(int tab_size, std::string str) { const std::string spaces(tab_size, ' '); -- cgit v1.2.3