From b22c80ad1d85ceaec3d04e2f54952520cf73db38 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Sat, 6 May 2006 13:41:59 +0000
Subject: [PATCH] remove various redundant key checks

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3477 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog     | 7 +++++++
 src/browser.c | 2 +-
 src/help.c    | 6 +++---
 src/text.c    | 3 +--
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 880e9f79..d10f9d82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -68,6 +68,9 @@ CVS code -
 	- Add the ability to move to the first and last line of the help
 	  text via Meta-\ (Meta-|) and Meta-/ (Meta-?).  Changes to
 	  shortcut_init() and do_help(). (DLR)
+- browser.c:
+  parse_browser_input()
+	- Remove redundant key checks. (DLR)
 - files.c:
   open_file()
 	- Remove redundant wording in the error message when we try to
@@ -125,6 +128,7 @@ CVS code -
 	  to check for a main shortcut key instead of both it and all of
 	  its equivalents. (DLR)
 	- Clean up the handling of NANO_REFRESH_KEY. (DLR)
+	- Remove redundant key checks. (DLR)
   help_init()
 	- If we have at least two entries' worth of blank space, use it
 	  to display more of "^Space" and "M-Space". (DLR, suggested by
@@ -133,6 +137,7 @@ CVS code -
 	- Add Space and - as aliases for PageDown and PageUp, for
 	  consistency with the file browser. (DLR, suggested by Benno
 	  Schulenberg)
+	- Remove redundant key checks. (DLR)
 - nano.c:
   renumber()
 	- Remove invalid assert. (DLR, found by Filipe Moreira)
@@ -171,6 +176,8 @@ CVS code -
 	- Change all rcfile error messages to refer to commands instead
 	  of directives, for consistency with nanorc.5. (DLR)
 - text.c:
+  do_justify()
+	- Remove redundant key checks. (DLR)
   do_spell()
 	- Clarify the error message when creating a temporary file
 	  fails. (DLR)
diff --git a/src/browser.c b/src/browser.c
index 62eb4be0..19b479bf 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -493,7 +493,7 @@ void parse_browser_input(int *kbinput, bool *meta_key, bool *func_key)
     get_shortcut(browser_list, kbinput, meta_key, func_key);
 
     /* Pico compatibility. */
-    if (*meta_key == FALSE && *func_key == FALSE) {
+    if (*meta_key == FALSE) {
 	switch (*kbinput) {
 	    case ' ':
 		*kbinput = NANO_NEXTPAGE_KEY;
diff --git a/src/help.c b/src/help.c
index 3ca686b2..3d4778c4 100644
--- a/src/help.c
+++ b/src/help.c
@@ -136,8 +136,8 @@ void do_help(void (*refresh_func)(void))
 		break;
 	}
 
-	if ((kbinput != ERR && line == old_line) || (!meta_key &&
-		!func_key && kbinput == NANO_REFRESH_KEY))
+	if ((kbinput != ERR && line == old_line) || kbinput ==
+		NANO_REFRESH_KEY)
 	    goto skip_redisplay;
 
 	blank_edit();
@@ -574,7 +574,7 @@ void parse_help_input(int *kbinput, bool *meta_key, bool *func_key)
 {
     get_shortcut(help_list, kbinput, meta_key, func_key);
 
-    if (*meta_key == FALSE && *func_key == FALSE) {
+    if (*meta_key == FALSE) {
 	switch (*kbinput) {
 	    /* For consistency with the file browser. */
 	    case ' ':
diff --git a/src/text.c b/src/text.c
index f4344026..26e31761 100644
--- a/src/text.c
+++ b/src/text.c
@@ -1671,8 +1671,7 @@ void do_justify(bool full_justify)
     kbinput = do_input(&meta_key, &func_key, &s_or_t, &ran_func,
 	&finished, FALSE);
 
-    if (!meta_key && !func_key && s_or_t &&
-	kbinput == NANO_UNJUSTIFY_KEY) {
+    if (s_or_t && kbinput == NANO_UNJUSTIFY_KEY) {
 	/* Splice the justify buffer back into the file, but only if we
 	 * actually justified something. */
 	if (first_par_line != NULL) {
-- 
GitLab