From: Felipe Contreras <felipe.contreras@gmail.com>
To: git@vger.kernel.org
Cc: "Martin Ågren" <martin.agren@gmail.com>,
"Felipe Contreras" <felipe.contreras@gmail.com>
Subject: [PATCH 1/2] config: avoid yoda conditions
Date: Sun, 13 Jun 2021 01:37:01 -0500 [thread overview]
Message-ID: <20210613063702.269816-2-felipe.contreras@gmail.com> (raw)
In-Reply-To: <20210613063702.269816-1-felipe.contreras@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
config.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config.c b/config.c
index f9c400ad30..7094530b04 100644
--- a/config.c
+++ b/config.c
@@ -1232,7 +1232,7 @@ static int git_parse_maybe_bool_text(const char *value)
int git_parse_maybe_bool(const char *value)
{
int v = git_parse_maybe_bool_text(value);
- if (0 <= v)
+ if (v >= 0)
return v;
if (git_parse_int(value, &v))
return !!v;
@@ -1242,7 +1242,7 @@ int git_parse_maybe_bool(const char *value)
int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
{
int v = git_parse_maybe_bool_text(value);
- if (0 <= v) {
+ if (v >= 0) {
*is_bool = 1;
return v;
}
--
2.32.0
next prev parent reply other threads:[~2021-06-13 6:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-13 6:37 [PATCH 0/2] Trivial cleanups Felipe Contreras
2021-06-13 6:37 ` Felipe Contreras [this message]
2021-06-13 6:37 ` [PATCH 2/2] add: avoid yoda condition Felipe Contreras
2021-06-15 1:45 ` [PATCH 0/2] Trivial cleanups Junio C Hamano
2021-06-15 8:22 ` Felipe Contreras
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210613063702.269816-2-felipe.contreras@gmail.com \
--to=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=martin.agren@gmail.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.