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

Jani Nikula jani at nikula.org
Sun Oct 1 13:53:21 PDT 2017


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



More information about the notmuch mailing list