tweaks: elide a function that has become too small for its two calls

master
Benno Schulenberg 2020-01-22 13:34:17 +01:00
parent e01e1d8ab5
commit a65f0ec80c
3 changed files with 4 additions and 10 deletions

View File

@ -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");

View File

@ -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);

View File

@ -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 == '[') {