Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
ielashi committed Sep 20, 2023
1 parent 5b8f8bf commit 1d5bd70
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/btreemap/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,15 @@ impl<K: Storable + Ord + Clone> Node<K> {
let header: NodeHeader = read_struct(address, memory);
assert_eq!(&header.magic, MAGIC, "Bad magic.");
match header.version {
LAYOUT_VERSION_1 => {
if let PageSize::Derived(DerivedPageSize {
LAYOUT_VERSION_1 => match page_size {
PageSize::Derived(DerivedPageSize {
max_key_size,
max_value_size,
}) = page_size
{
Self::load_v1(header, address, max_key_size, max_value_size, memory)
} else {
}) => Self::load_v1(header, address, max_key_size, max_value_size, memory),
PageSize::Value(_) => {
unreachable!("Tried to load a V1 node without a derived PageSize.")
}
}
},
LAYOUT_VERSION_2 => Self::load_v2(address, page_size, header, memory),
unknown_version => unreachable!("Unsupported version {unknown_version}."),
}
Expand Down

0 comments on commit 1d5bd70

Please # to comment.