kernel/cache: Set parent_data outside the if-block.

Reduces code duplication while retaining clarity.
Thanks axeld for the review.
This commit is contained in:
Augustin Cavalier
2022-02-11 14:43:48 -05:00
parent a04ae8afcf
commit 71f4447184
+2 -2
View File
@@ -3055,11 +3055,11 @@ cache_detach_sub_transaction(void* _cache, int32 id,
if (block->parent_data != block->current_data) {
// The block had been changed in both transactions
block->original_data = block->parent_data;
block->parent_data = NULL;
} else {
// The block has only been changed in the parent
block->original_data = block->parent_data = NULL;
block->original_data = NULL;
}
block->parent_data = NULL;
// move the block to the previous transaction list
transaction->blocks.Add(block);