diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2016-01-25 07:38:37 +0100 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2016-01-25 07:38:37 +0100 |
commit | cfaacc07dc2861df6fe0c06f395b3ebc45eb3cac (patch) | |
tree | 5cc535f6abc72d7d134b386a9b5547c829c0e37b /src | |
parent | Merge pull request #1371 from lioncash/return (diff) | |
parent | key_map: Use std::tie for comparisons (diff) | |
download | yuzu-cfaacc07dc2861df6fe0c06f395b3ebc45eb3cac.tar yuzu-cfaacc07dc2861df6fe0c06f395b3ebc45eb3cac.tar.gz yuzu-cfaacc07dc2861df6fe0c06f395b3ebc45eb3cac.tar.bz2 yuzu-cfaacc07dc2861df6fe0c06f395b3ebc45eb3cac.tar.lz yuzu-cfaacc07dc2861df6fe0c06f395b3ebc45eb3cac.tar.xz yuzu-cfaacc07dc2861df6fe0c06f395b3ebc45eb3cac.tar.zst yuzu-cfaacc07dc2861df6fe0c06f395b3ebc45eb3cac.zip |
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 @@ #pragma once +#include <tuple> #include "core/hle/service/hid/hid.h" namespace KeyMap { @@ -15,15 +16,14 @@ struct HostDeviceKey { int key_code; int device_id; ///< Uniquely identifies a host device - bool operator < (const HostDeviceKey &other) const { - if (device_id == other.device_id) { - return key_code < other.key_code; - } - return device_id < other.device_id; + bool operator<(const HostDeviceKey &other) const { + return std::tie(key_code, device_id) < + std::tie(other.key_code, other.device_id); } - bool operator == (const HostDeviceKey &other) const { - return device_id == other.device_id && key_code == other.key_code; + bool operator==(const HostDeviceKey &other) const { + return std::tie(key_code, device_id) == + std::tie(other.key_code, other.device_id); } }; |