From: Benno Schulenberg Date: Tue, 13 May 2014 20:20:51 +0000 (+0000) Subject: Condensing a function a bit. X-Git-Tag: v2.3.3~55 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=745410336b6d9c08357e11de2bbeb7d202731244;p=nano.git Condensing a function a bit. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4875 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- 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; }