checkpolicy: simplify assignment

checkpolicy.c:504:20: style: The statement 'if (policyvers!=n) policyvers=n' is logically equivalent to 'policyvers=n'. [duplicateConditionalAssign]
    if (policyvers != n)
                   ^
checkpolicy.c:505:17: note: Assignment 'policyvers=n'
     policyvers = n;
                ^
checkpolicy.c:504:20: note: Condition 'policyvers!=n' is redundant
    if (policyvers != n)
                   ^

Found by Cppcheck

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
Christian Göttsche 2021-07-06 19:54:23 +02:00 committed by Nicolas Iooss
parent 02678b9d40
commit 7cdb2a8fd2
No known key found for this signature in database
GPG Key ID: C191415F340DAAA0

View File

@ -504,8 +504,7 @@ int main(int argc, char **argv)
usage(argv[0]);
exit(1);
}
if (policyvers != n)
policyvers = n;
policyvers = n;
break;
}
case 'E':