commit 4d6d7d91c1672bd867c6dc1242e2dd2258698df9
parent 85170f6b38620fddbf8b08b13a3b293f4db62d3e
Author: sin <sin@2f30.org>
Date: Tue, 5 Mar 2019 11:17:37 +0000
Unify conditionals
Diffstat:
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/dedup.c b/dedup.c
@@ -414,15 +414,11 @@ check_cache_entry(struct snapshot *snap, void *arg)
blk_desc = &snap->blk_desc[i];
memcpy(&cache_entry.md, blk_desc->md, sizeof(cache_entry.md));
- if (lookup_cache_entry(cache, &cache_entry) < 0) {
+ if (lookup_cache_entry(cache, &cache_entry) < 0 ||
+ cache_entry.offset != blk_desc->offset ||
+ cache_entry.size != blk_desc->size) {
*ret = -1;
return WALK_STOP;
- } else {
- if (cache_entry.offset != blk_desc->offset ||
- cache_entry.size != blk_desc->size) {
- *ret = -1;
- return WALK_STOP;
- }
}
}
return WALK_CONTINUE;