From 08e183d322981c705ba9fc7f4f1476cc7e7e5f23 Mon Sep 17 00:00:00 2001 From: "Dr. Dystopia" Date: Sun, 19 Jul 2026 20:30:21 +0200 Subject: Replace string concatination with `fmt::format` --- Source/Core/InputCommon/ControllerInterface/SDL/SDLGamepad.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/SDL') diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDLGamepad.h b/Source/Core/InputCommon/ControllerInterface/SDL/SDLGamepad.h index 0a431866e7..a997437f61 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDLGamepad.h +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDLGamepad.h @@ -7,6 +7,7 @@ #include #include +#include #include "Common/MathUtil.h" @@ -16,17 +17,17 @@ namespace { std::string GetLegacyButtonName(int index) { - return "Button " + std::to_string(index); + return fmt::format("Button {}", index); } std::string GetLegacyAxisName(int index, int range) { - return "Axis " + std::to_string(index) + (range < 0 ? '-' : '+'); + return fmt::format("Axis {}{}", index, range < 0 ? '-' : '+'); } std::string GetLegacyHatName(int index, int direction) { - return "Hat " + std::to_string(index) + ' ' + "NESW"[direction]; + return fmt::format("Hat {} {}", index, "NESW"[direction]); } constexpr int GetDirectionFromHatMask(int mask) -- cgit v1.2.3