mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-09-07 22:21:32 +00:00
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:
+2
-10
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user