diff options
| author | 2016-01-25 01:19:21 -0500 | |
|---|---|---|
| committer | 2016-01-25 01:19:21 -0500 | |
| commit | 3933b68c5977a581e63ce1a29352fba3f7c2a97e (patch) | |
| tree | c92dc90cb3b13fed9e0809d2cf188af0c946d162 /src | |
| parent | Merge pull request #1334 from tfarley/hw-depth-modifiers (diff) | |
| download | yuzu-3933b68c5977a581e63ce1a29352fba3f7c2a97e.tar.gz yuzu-3933b68c5977a581e63ce1a29352fba3f7c2a97e.tar.xz yuzu-3933b68c5977a581e63ce1a29352fba3f7c2a97e.zip | |
key_map: Use std::tie for comparisons
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/key_map.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/common/key_map.h b/src/common/key_map.h index 0ecec714f..68f7e2f99 100644 --- a/src/common/key_map.h +++ b/src/common/key_map.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <tuple> | ||
| 7 | #include "core/hle/service/hid/hid.h" | 8 | #include "core/hle/service/hid/hid.h" |
| 8 | 9 | ||
| 9 | namespace KeyMap { | 10 | namespace KeyMap { |
| @@ -15,15 +16,14 @@ struct HostDeviceKey { | |||
| 15 | int key_code; | 16 | int key_code; |
| 16 | int device_id; ///< Uniquely identifies a host device | 17 | int device_id; ///< Uniquely identifies a host device |
| 17 | 18 | ||
| 18 | bool operator < (const HostDeviceKey &other) const { | 19 | bool operator<(const HostDeviceKey &other) const { |
| 19 | if (device_id == other.device_id) { | 20 | return std::tie(key_code, device_id) < |
| 20 | return key_code < other.key_code; | 21 | std::tie(other.key_code, other.device_id); |
| 21 | } | ||
| 22 | return device_id < other.device_id; | ||
| 23 | } | 22 | } |
| 24 | 23 | ||
| 25 | bool operator == (const HostDeviceKey &other) const { | 24 | bool operator==(const HostDeviceKey &other) const { |
| 26 | return device_id == other.device_id && key_code == other.key_code; | 25 | return std::tie(key_code, device_id) == |
| 26 | std::tie(other.key_code, other.device_id); | ||
| 27 | } | 27 | } |
| 28 | }; | 28 | }; |
| 29 | 29 | ||