2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Merge pull request #1372 from lioncash/tie

key_map: Use std::tie for comparisons
This commit is contained in:
Yuri Kunde Schlesner 2016-01-24 22:38:37 -08:00
commit cfaacc07dc

View file

@ -4,6 +4,7 @@
#pragma once
#include <tuple>
#include "core/hle/service/hid/hid.h"
namespace KeyMap {
@ -16,14 +17,13 @@ struct HostDeviceKey {
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;
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;
return std::tie(key_code, device_id) ==
std::tie(other.key_code, other.device_id);
}
};