mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	Merge pull request #1372 from lioncash/tie
key_map: Use std::tie for comparisons
This commit is contained in:
		
						commit
						cfaacc07dc
					
				
					 1 changed files with 7 additions and 7 deletions
				
			
		|  | @ -4,6 +4,7 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
|  | #include <tuple> | ||||||
| #include "core/hle/service/hid/hid.h" | #include "core/hle/service/hid/hid.h" | ||||||
| 
 | 
 | ||||||
| namespace KeyMap { | namespace KeyMap { | ||||||
|  | @ -15,15 +16,14 @@ struct HostDeviceKey { | ||||||
|     int key_code; |     int key_code; | ||||||
|     int device_id; ///< Uniquely identifies a host device
 |     int device_id; ///< Uniquely identifies a host device
 | ||||||
| 
 | 
 | ||||||
|     bool operator < (const HostDeviceKey &other) const { |     bool operator<(const HostDeviceKey &other) const { | ||||||
|         if (device_id == other.device_id) { |         return std::tie(key_code, device_id) < | ||||||
|             return key_code < other.key_code; |                std::tie(other.key_code, other.device_id); | ||||||
|         } |  | ||||||
|         return device_id < other.device_id; |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     bool operator == (const HostDeviceKey &other) const { |     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); | ||||||
|     } |     } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue