From 32187716f7cb4842d1bea9049960e662c6ccc420 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 13 May 2014 20:34:15 +0000 Subject: [PATCH] No need to keep on looping when two shortcuts were found. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4876 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 1 + src/help.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54c7f283..de2fdc5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ lists with functions and shortcuts. * src/*.c: Several random whitespace and comment tweaks. * src/global.c (replace_scs_for): Condense the function a bit. + * src/help.c (help_init): No need to keep looping when two are found. 2014-05-12 Benno Schulenberg * src/text.c (do_spell): Provide startup feedback, as for the linter. diff --git a/src/help.c b/src/help.c index ee4717b0..ea6b9241 100644 --- a/src/help.c +++ b/src/help.c @@ -425,9 +425,6 @@ void help_init(void) /* Let's simply show the first two shortcuts from the list. */ for (s = sclist, scsfound = 0; s != NULL; s = s->next) { - if (scsfound == 2) - continue; - if (s->type == RAWINPUT) continue; @@ -443,6 +440,7 @@ void help_init(void) ptr += 6; } else { ptr += sprintf(ptr, "(%s)\t", s->keystr); + break; } } }