[PATCH v2 12/15] cli: reduce indent in keyword argument processing

Subject: [PATCH v2 12/15] cli: reduce indent in keyword argument processing

Date: Sun, 1 Oct 2017 23:53:21 +0300

To: notmuch@notmuchmail.org

Cc: Daniel Kahn Gillmor

From: Jani Nikula


Reducing indent makes future changes easier. No functional changes.
---
 command-line-arguments.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/command-line-arguments.c b/command-line-arguments.c
index c591dcbec7cc..3fa8d9044966 100644
--- a/command-line-arguments.c
+++ b/command-line-arguments.c
@@ -21,13 +21,15 @@ _process_keyword_arg (const notmuch_opt_desc_t *arg_desc, char next, const char
     }
 
     for (keywords = arg_desc->keywords; keywords->name; keywords++) {
-	if (strcmp (arg_str, keywords->name) == 0) {
-	    if (arg_desc->opt_flags)
-		*arg_desc->opt_flags |= keywords->value;
-	    else
-		*arg_desc->opt_keyword = keywords->value;
-	    return TRUE;
-	}
+	if (strcmp (arg_str, keywords->name) != 0)
+	    continue;
+
+	if (arg_desc->opt_flags)
+	    *arg_desc->opt_flags |= keywords->value;
+	else
+	    *arg_desc->opt_keyword = keywords->value;
+
+	return TRUE;
     }
     if (next != '\0')
 	fprintf (stderr, "Unknown keyword argument \"%s\" for option \"%s\".\n", arg_str, arg_desc->name);
-- 
2.11.0

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: