diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2025-05-15 13:11:45 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-05-15 13:46:47 -0700 |
commit | 3d39bcd98ecce0fce77b00fd680bd245b2161ddf (patch) | |
tree | 42d0595e15c652871e5651a6e61b7cce3754b18b /help.c | |
parent | 6c91162449cb0a2fe3c42a1caa232444afed9c7c (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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++; } |