summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiriam Rubio <mirucam@gmail.com>2020-02-17 08:40:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-19 17:37:14 (GMT)
commitb8e3b2f33994de25c068021e388dbef72a2cdc4a (patch)
tree2298d072e5ac5dc8433ed00afe03242cbb495fa5
parent292731c4c24bce5c9e3bdc7a246cfbc565ab93a1 (diff)
downloadgit-b8e3b2f33994de25c068021e388dbef72a2cdc4a.zip
git-b8e3b2f33994de25c068021e388dbef72a2cdc4a.tar.gz
git-b8e3b2f33994de25c068021e388dbef72a2cdc4a.tar.bz2
bisect: use the standard 'if (!var)' way to check for 0
Instead of using 'var == 0' in an if condition, let's use '!var' and make 'bisect.c' more consistent with the rest of the code. Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Miriam Rubio <mirucam@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--bisect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bisect.c b/bisect.c
index e81c91d..83cb5b3 100644
--- a/bisect.c
+++ b/bisect.c
@@ -572,7 +572,7 @@ static int sqrti(int val)
{
float d, x = val;
- if (val == 0)
+ if (!val)
return 0;
do {
@@ -869,7 +869,7 @@ static void check_good_are_ancestors_of_bad(struct repository *r,
goto done;
/* Bisecting with no good rev is ok. */
- if (good_revs.nr == 0)
+ if (!good_revs.nr)
goto done;
/* Check if all good revs are ancestor of the bad rev. */