diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-07-26 01:44:25 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-07-26 01:50:36 +0200 |
| commit | a4138201b09fa70bbccdeadf1f80bbc9ebe32046 (patch) | |
| tree | 83377e9daba61479805806b7b4d6e2430a2451a3 /src/keys.hh | |
| parent | eedd37c09acace58ceadacf8ecf9e883a2fd5a4a (diff) | |
Key: always pass by value
Diffstat (limited to 'src/keys.hh')
| -rw-r--r-- | src/keys.hh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/keys.hh b/src/keys.hh index 0df78853..cfff452f 100644 --- a/src/keys.hh +++ b/src/keys.hh @@ -44,17 +44,17 @@ struct Key constexpr Key(Codepoint key) : modifiers(Modifiers::None), key(key) {} - constexpr bool operator==(const Key& other) const + constexpr bool operator==(Key other) const { return modifiers == other.modifiers and key == other.key; } - constexpr bool operator!=(const Key& other) const + constexpr bool operator!=(Key other) const { return modifiers != other.modifiers or key != other.key; } }; typedef std::vector<Key> KeyList; KeyList parse_keys(const String& str); -String key_to_str(const Key& key); +String key_to_str(Key key); } @@ -64,7 +64,7 @@ namespace std template<> struct hash<Kakoune::Key> : unary_function<const Kakoune::Key&, size_t> { - size_t operator()(const Kakoune::Key& key) const + size_t operator()(Kakoune::Key key) const { return static_cast<size_t>(key.modifiers) * 1024 + key.key; } |
