commit a65f0ec80ca2d00ff6b45ba9b27c731fd4778246
parent e01e1d8ab5c24da686166538bd57b624befe3513
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 22 Jan 2020 13:34:17 +0100
tweaks: elide a function that has become too small for its two calls
Diffstat:
3 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/src/global.c b/src/global.c
@@ -392,7 +392,8 @@ void add_to_sclist(int menus, const char *scstring, const int keycode,
if (toggle)
s->ordinal = (tailsc->toggle == toggle) ? counter : ++counter;
#endif
- assign_keyinfo(s, scstring, keycode);
+ s->keystr = scstring;
+ s->keycode = (keycode ? keycode : keycode_from_string(scstring));
tailsc = s;
}
@@ -527,13 +528,6 @@ int keycode_from_string(const char *keystring)
return -1;
}
-/* Set the string and its corresponding keycode for the given shortcut s. */
-void assign_keyinfo(keystruct *s, const char *keystring, const int keycode)
-{
- s->keystr = keystring;
- s->keycode = (keycode ? keycode : keycode_from_string(keystring));
-}
-
/* These two tags are used elsewhere too, so they are global. */
/* TRANSLATORS: Try to keep the next two strings at most 10 characters. */
const char *exit_tag = N_("Exit");
diff --git a/src/proto.h b/src/proto.h
@@ -334,7 +334,6 @@ size_t shown_entries_for(int menu);
const keystruct *get_shortcut(int *kbinput);
functionptrtype func_from_key(int *kbinput);
int keycode_from_string(const char *keystring);
-void assign_keyinfo(keystruct *s, const char *keystring, const int keycode);
void shortcut_init(void);
const char *flagtostr(int flag);
diff --git a/src/rcfile.c b/src/rcfile.c
@@ -820,7 +820,8 @@ void parse_binding(char *ptr, bool dobind)
}
newsc->menus = menu;
- assign_keyinfo(newsc, keycopy, keycode);
+ newsc->keystr = keycopy;
+ newsc->keycode = keycode;
/* Disallow rebinding ^[ and frequent escape-sequence starter "Esc [". */
if (newsc->keycode == ESC_CODE || newsc->keycode == '[') {