-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DAOS-16954 Fix the tree->embedded case + simplify the logic
In the previous commit, I made a mistake when fixing the embedded value case. Because it remained unnoticed, I think it is fair to say the current `btr_root_del_rec()` logic is a little confusing. With this commit, I hope to both fix my mistake and simplify the logic so this kind of mistake won't happen in the future. What is simplified: - if it is an embedded value destroy it straight away, - mostly restore the pre-embedded value logic without consideration for embedded values with one exception, - if the root is a leaf and there is more than one key remaining: - if there are exactly two keys and the embedded value is supported, the tree should be replaced with an embedded value. Since both: - deleting the embedded value and - deleting the last key from a regular tree, are the same a `btr_root_del_rec_last()` helper function has been introduced. Signed-off-by: Jan Michalski <[email protected]> Co-authored-by: Tomasz Gromadzki <[email protected]>
- Loading branch information
Showing
1 changed file
with
61 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters