]> git.ipfire.org Git - thirdparty/git.git/commitdiff
bisect: use the standard 'if (!var)' way to check for 0
authorMiriam Rubio <mirucam@gmail.com>
Mon, 17 Feb 2020 08:40:30 +0000 (09:40 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 19 Feb 2020 17:37:14 +0000 (09:37 -0800)
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>
bisect.c

index e81c91d02c07552dd50e82d42ae3e14f81945e01..83cb5b3a9847d5dfd72889c188f6c222f5288198 100644 (file)
--- 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. */