Skip to content

Commit

Permalink
Fix panic in compact()
Browse files Browse the repository at this point in the history
This also greatly improves performance in certain cases
  • Loading branch information
cberner committed Aug 20, 2023
1 parent 1db7f62 commit 47d7c94
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tree_store/page_store/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,12 @@ impl PageNumber {
if self.region < other.region {
return true;
}
if self.region > other.region {
return false;
}
let self_order0 = self.page_index * 2u32.pow(self.page_order as u32);
let other_order0 = other.page_index * 2u32.pow(other.page_order as u32);
assert_ne!(self_order0, other_order0);
assert_ne!(self_order0, other_order0, "{self:?} overlaps {other:?}");
self_order0 < other_order0
}

Expand Down

0 comments on commit 47d7c94

Please sign in to comment.