vim-patch:9.1.0073: Looping over modifier_keys_table unnecessarily

Problem:  Looping over modifier_keys_table[] unnecessarily with only
          MOD_MASK_ALT or MOD_MASK_CMD, as modifier_keys_table[] only
          contains MOD_MASK_SHIFT and MOD_MASK_CTRL, and the loop won't
          do anything.
Solution: Remove MOD_MASK_ALT and MOD_MASK_CMD from the condition.
          (zeertzjq)

closes: vim/vim#13963

0c989e4a3a
This commit is contained in:
zeertzjq
2024-02-04 06:42:47 +08:00
parent c559ab0ae6
commit 60701f4fff

View File

@@ -400,7 +400,7 @@ int name_to_mod_mask(int c)
int simplify_key(const int key, int *modifiers) int simplify_key(const int key, int *modifiers)
FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
{ {
if (!(*modifiers & (MOD_MASK_SHIFT | MOD_MASK_CTRL | MOD_MASK_ALT))) { if (!(*modifiers & (MOD_MASK_SHIFT | MOD_MASK_CTRL))) {
return key; return key;
} }