git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: gitster@pobox.com
Cc: git@vger.kernel.org, Stefan Beller <sbeller@google.com>
Subject: [PATCH 1/2] config.c: drop local variable
Date: Wed, 27 Apr 2016 14:30:39 -0700	[thread overview]
Message-ID: <1461792640-18898-1-git-send-email-sbeller@google.com> (raw)

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 <sbeller@google.com>
---

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

             reply	other threads:[~2016-04-27 21:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27 21:30 Stefan Beller [this message]
2016-04-27 21:30 ` [PATCH 2/2] submodule-config: don't shadow `cache` Stefan Beller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461792640-18898-1-git-send-email-sbeller@google.com \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).