Message ID | 20191017070513.13445-1-yamato@redhat.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [1/3] checkpolicy: remove a redundant if-condition | expand |
diff --git a/checkpolicy/checkpolicy.c b/checkpolicy/checkpolicy.c index f928ec06..e18de171 100644 --- a/checkpolicy/checkpolicy.c +++ b/checkpolicy/checkpolicy.c @@ -682,9 +682,7 @@ int main(int argc, char **argv) } } - if (outfile) { - fclose(outfp); - } + fclose(outfp); } else if (cil) { fprintf(stderr, "%s: No file to write CIL was specified\n", argv[0]); exit(1);
Inner if-condition in following code is redundant: if (outfile) { /* ... just referring outfile ... */ if (outfile) { do_something(); } } We can simplify this to: if (outfile) { /* ... just referring outfile ... */ do_something(); } Signed-off-by: Masatake YAMATO <yamato@redhat.com> --- checkpolicy/checkpolicy.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)