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/InputCommon/ControllerInterface/MappingCommon.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp b/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp index 56bab1a981..4acee6a970 100644 --- a/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp +++ b/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp @@ -9,6 +9,7 @@ #include #include +#include #include "Common/StringUtil.h" #include "InputCommon/ControllerInterface/CoreDevice.h" @@ -96,12 +97,12 @@ BuildExpression(const std::vector if (is_hotkey) { - alternations.push_back(fmt::format("@({})", JoinStrings(alternation, "+"))); + alternations.push_back(fmt::format("@({})", fmt::join(alternation, "+"))); } else { std::sort(alternation.begin(), alternation.end()); - alternations.push_back(JoinStrings(alternation, "&")); + alternations.push_back(fmt::to_string(fmt::join(alternation, "&"))); } }; @@ -130,7 +131,7 @@ BuildExpression(const std::vector std::sort(alternations.begin(), alternations.end()); alternations.erase(std::unique(alternations.begin(), alternations.end()), alternations.end()); - return JoinStrings(alternations, "|"); + return fmt::to_string(fmt::join(alternations, "|")); } void RemoveSpuriousTriggerCombinations( -- cgit v1.2.3