Skip to content

Commit b8e3b2f

Browse files
mirucamgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Miriam Rubio <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 292731c commit b8e3b2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bisect.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ static int sqrti(int val)
572572
{
573573
float d, x = val;
574574

575-
if (val == 0)
575+
if (!val)
576576
return 0;
577577

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

871871
/* Bisecting with no good rev is ok. */
872-
if (good_revs.nr == 0)
872+
if (!good_revs.nr)
873873
goto done;
874874

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

0 commit comments

Comments
 (0)