From 3d39bcd98ecce0fce77b00fd680bd245b2161ddf Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 15 May 2025 13:11:45 +0000 Subject: 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 Signed-off-by: Junio C Hamano --- help.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'help.c') 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++; } -- cgit v1.3