diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp index 03341941b5..53e8a05a18 100644 --- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp +++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp @@ -965,13 +965,17 @@ void Refresh() s_wiimote_scanner.SetScanMode(WiimoteScanMode::SCAN_ONCE); } -bool IsValidDeviceName(const std::string& name) +bool IsValidDeviceName(std::string_view name) { - return "Nintendo RVL-CNT-01" == name || "Nintendo RVL-CNT-01-TR" == name || - IsBalanceBoardName(name); + return IsWiimoteName(name) || IsBalanceBoardName(name); } -bool IsBalanceBoardName(const std::string& name) +bool IsWiimoteName(std::string_view name) +{ + return name == "Nintendo RVL-CNT-01" || name == "Nintendo RVL-CNT-01-TR"; +} + +bool IsBalanceBoardName(std::string_view name) { return "Nintendo RVL-WBC-01" == name; } diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h index 04c1e0246f..a54cca3a6c 100644 --- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h +++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -225,8 +226,10 @@ extern std::unique_ptr g_wiimotes[MAX_BBMOTES]; void AddWiimoteToPool(std::unique_ptr); -bool IsValidDeviceName(const std::string& name); -bool IsBalanceBoardName(const std::string& name); +bool IsValidDeviceName(std::string_view name); +bool IsWiimoteName(std::string_view name); +bool IsBalanceBoardName(std::string_view name); + bool IsNewWiimote(const std::string& identifier); bool IsKnownDeviceId(const USBUtils::DeviceInfo&);