summaryrefslogtreecommitdiff
path: root/help.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2025-05-15 13:11:45 +0000
committerJunio C Hamano <gitster@pobox.com>2025-05-15 13:46:47 -0700
commit3d39bcd98ecce0fce77b00fd680bd245b2161ddf (patch)
tree42d0595e15c652871e5651a6e61b7cce3754b18b /help.c
parent6c91162449cb0a2fe3c42a1caa232444afed9c7c (diff)
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>
Diffstat (limited to 'help.c')
-rw-r--r--help.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/help.c b/help.c
index 6ef90838f1..21b778707a 100644
--- a/help.c
+++ b/help.c
@@ -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++;
}