1
1
forked from 0ad/0ad

Fix nopch / tiny hotkey optimisation

Swap an std::set for an std::vector, the set was useful only in an
earlier iteration of the diff. This fixes nopch.

Differential Revision: https://code.wildfiregames.com/D3790
This was SVN commit r25195.
This commit is contained in:
wraitii 2021-04-06 12:26:34 +00:00
parent 93d22ef16b
commit 80f354a125

View File

@ -300,13 +300,13 @@ InReaction HotkeyInputPrepHandler(const SDL_Event_* ev)
activeScancodes.emplace_back(scancode);
}
std::set<SDL_Scancode_> triggers;
std::vector<SDL_Scancode_> triggers;
if (!isReleasedKey || isInstantaneous)
triggers.insert(scancode);
triggers.push_back(scancode);
else
// If the key is released, we need to check all less precise hotkeys again, to see if we should retrigger some.
for (SDL_Scancode_ code : activeScancodes)
triggers.insert(code);
triggers.push_back(code);
// Now check if we need to trigger new hotkeys / retrigger hotkeys.
// We'll need the match-level and the keys in play to release currently pressed hotkeys.