Inverse condition to avoid nesting in test(1)

This commit is contained in:
sin 2013-11-11 11:26:29 +00:00
parent c55948ba91
commit af1fb0c9c2

4
test.c
View File

@ -113,7 +113,8 @@ binary(const char *arg1, const char *op, const char *arg2)
}; };
for (i = 0; i < LEN(optexts); i++) { for (i = 0; i < LEN(optexts); i++) {
if (strcmp(op, optexts[i]) == 0) { if (strcmp(op, optexts[i]) != 0)
continue;
oper = i; oper = i;
switch (oper) { switch (oper) {
case STREQ: case STREQ:
@ -141,7 +142,6 @@ binary(const char *arg1, const char *op, const char *arg2)
} }
} }
} }
}
return false; return false;
} }