diff --git a/ChangeLog b/ChangeLog index 3a6c6f8a..54c7f283 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ * src/global.c (thanks_for_all_the_fish): Upon exit also free the lists with functions and shortcuts. * src/*.c: Several random whitespace and comment tweaks. + * src/global.c (replace_scs_for): Condense the function a bit. 2014-05-12 Benno Schulenberg * src/text.c (do_spell): Provide startup feedback, as for the linter. diff --git a/src/global.c b/src/global.c index 3b0474f2..11a70d4e 100644 --- a/src/global.c +++ b/src/global.c @@ -373,15 +373,12 @@ void add_to_sclist(int menu, const char *scstring, void (*func)(void), int toggl #endif } -/* Assign one menu's shortcuts to another function. */ +/* Assign one function's shortcuts to another function. */ void replace_scs_for(void (*oldfunc)(void), void (*newfunc)(void)) { sc *s; - if (sclist == NULL) - return; - - for (s = sclist; s->next != NULL; s = s->next) + for (s = sclist; s != NULL; s = s->next) if (s->scfunc == oldfunc) { s->scfunc = newfunc; }