summaryrefslogtreecommitdiff
path: root/src/hotkeys.cpp
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-02-12 22:59:12 +0000
committerPeterN <peter@fuzzle.org>2019-03-26 20:15:57 +0000
commit5795f66d2eebccbc8e04b80ebaf163f636479f9e (patch)
tree53bedfa6e40953f7aaeba3f7c2648e0839aef354 /src/hotkeys.cpp
parentb1f5119d3af2fb47a2f1c752d61a742f41076451 (diff)
downloadopenttd-5795f66d2eebccbc8e04b80ebaf163f636479f9e.tar.xz
Codechange: Replaced SmallVector::Contains() with std::find() pattern
Diffstat (limited to 'src/hotkeys.cpp')
-rw-r--r--src/hotkeys.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp
index 9f323bc28..24e6b6c41 100644
--- a/src/hotkeys.cpp
+++ b/src/hotkeys.cpp
@@ -301,7 +301,9 @@ void HotkeyList::Save(IniFile *ini) const
int HotkeyList::CheckMatch(uint16 keycode, bool global_only) const
{
for (const Hotkey *list = this->items; list->name != NULL; ++list) {
- if (list->keycodes.Contains(keycode | WKC_GLOBAL_HOTKEY) || (!global_only && list->keycodes.Contains(keycode))) {
+ auto begin = list->keycodes.begin();
+ auto end = list->keycodes.end();
+ if (std::find(begin, end, keycode | WKC_GLOBAL_HOTKEY) != end || (!global_only && std::find(begin, end, keycode) != end)) {
return list->num;
}
}