Avoid redundant conditions

While `if (i <= 0) ... else if (i > 0) ...` is technically equivalent to
`if (i <= 0) ... else ...`, the latter is vastly easier to read because
it avoids writing out a condition that is unnecessary. Let's drop such
unnecessary conditions.

Pointed out by CodeQL.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin
2025-05-15 13:11:45 +00:00
committed by Junio C Hamano
parent 6c91162449
commit 3d39bcd98e
2 changed files with 2 additions and 2 deletions

2
help.c
View File

@@ -214,7 +214,7 @@ void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes)
else if (cmp == 0) {
ei++;
free(cmds->names[ci++]);
} else if (cmp > 0)
} else
ei++;
}