diff options
| author | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-09-22 00:24:21 -0700 |
|---|---|---|
| committer | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-09-22 21:09:36 -0700 |
| commit | 5f906736863f35a7018aaa11a7cac408229c21cf (patch) | |
| tree | 5449078c9489852efa511803cd06e3e8bc5c7728 /Source/Core/Common/StringUtil.cpp | |
| parent | de67c4c93bd15846f68df4006dd2c93fba5720d2 (diff) | |
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.
Diffstat (limited to 'Source/Core/Common/StringUtil.cpp')
| -rw-r--r-- | Source/Core/Common/StringUtil.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
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<std::string> SplitString(const std::string& str, const char delim) return output; } -std::string JoinStrings(const std::vector<std::string>& 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<std::string>(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, ' '); |
