From 7ae10e2e22c60ebe2cc8f7c65fa869083aa709ec Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Mon, 22 Aug 2016 10:12:25 -0700 Subject: [PATCH] Simplify branch code in hash_needs_work. These simple branches can be expressed in simply 1 line instead of 5, without comprimising legibility. --- src/verify.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/verify.c b/src/verify.c index 15149882..214d3277 100644 --- a/src/verify.c +++ b/src/verify.c @@ -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)); } }