diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-03-08 11:40:50 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-03-08 11:40:50 +0000 |
| commit | 0bbaef6e48c7a22b59e2c70304f6ccbf17324412 (patch) | |
| tree | a95dc56fac7cdc76383eb2ced803d58834f6b933 /src/normal.hh | |
| parent | 3ece7bcf75d3cb7e2dad50497c11d1069f486c0e (diff) | |
Use a sorted array for keymap rather than an unordered map
with ~100 entry, a binary search finds in < 7 step, unordered map
is overkill.
Diffstat (limited to 'src/normal.hh')
| -rw-r--r-- | src/normal.hh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/normal.hh b/src/normal.hh index 7f90075d..4a453415 100644 --- a/src/normal.hh +++ b/src/normal.hh @@ -18,12 +18,13 @@ struct NormalParams struct NormalCmdDesc { + Key key; StringView docstring; void (*func)(Context& context, NormalParams params); }; -using KeyMap = UnorderedMap<Key, NormalCmdDesc>; -extern const KeyMap keymap; +using KeyMap = Vector<NormalCmdDesc>; +extern KeyMap keymap; } |
