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>
maint
Miriam Rubio 2020-02-17 09:40:30 +01:00 committed by Junio C Hamano
parent 292731c4c2
commit b8e3b2f339
1 changed files with 2 additions and 2 deletions

View File

@ -572,7 +572,7 @@ static int sqrti(int val)
{ {
float d, x = val; float d, x = val;


if (val == 0) if (!val)
return 0; return 0;


do { do {
@ -869,7 +869,7 @@ static void check_good_are_ancestors_of_bad(struct repository *r,
goto done; goto done;


/* Bisecting with no good rev is ok. */ /* Bisecting with no good rev is ok. */
if (good_revs.nr == 0) if (!good_revs.nr)
goto done; goto done;


/* Check if all good revs are ancestor of the bad rev. */ /* Check if all good revs are ancestor of the bad rev. */