Thread (2 messages) flat view 2 messages, 1 author, 2016-06-16
DORMANTno replies

[PATCH 1/2] config.c: drop local variable

From: Stefan Beller <hidden>
Date: 2016-06-16 02:19:02
Subsystem: the rest · Maintainer: Linus Torvalds

As `ret` is not used for anything except determining an early return,
we don't need a variable for that. Drop it.

Signed-off-by: Stefan Beller <redacted>
---

While reading config code, I found 2 nits. Both improve readability,
no bugfix or feature.

As it is generally discouraged to have cleanup patch churn,
I checked master..pu to see any possible topics in flight conflicting
on config.c or submodule-config.c and there is nothing close by.

Thanks,
Stefan

 config.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/config.c b/config.c
index 10b5c95..262d8d7 100644
--- a/config.c
+++ b/config.c
@@ -1309,14 +1309,11 @@ static struct config_set_element *configset_find_element(struct config_set *cs,
 	struct config_set_element k;
 	struct config_set_element *found_entry;
 	char *normalized_key;
-	int ret;
 	/*
 	 * `key` may come from the user, so normalize it before using it
 	 * for querying entries from the hashmap.
 	 */
-	ret = git_config_parse_key(key, &normalized_key, NULL);
-
-	if (ret)
+	if (git_config_parse_key(key, &normalized_key, NULL))
 		return NULL;
 
 	hashmap_entry_init(&k, strhash(normalized_key));
-- 
2.8.0.41.g0ac0153.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help