Simplify branch code in hash_needs_work.

These simple branches can be expressed in simply 1 line instead
of 5, without comprimising legibility.
This commit is contained in:
Auke Kok
2016-08-23 16:33:11 -07:00
committed by Tudor Marcu
parent 4a303e35e6
commit 7ae10e2e22
+2 -10
View File
@@ -203,17 +203,9 @@ err:
static bool hash_needs_work(struct file *file, char *hash)
{
if (cmdline_option_quick) {
if (hash_is_zeros(hash)) {
return true;
} else {
return false;
}
return (hash_is_zeros(hash));
} else {
if (hash_equal(file->hash, hash)) {
return false;
} else {
return true;
}
return (!hash_equal(file->hash, hash));
}
}