Skip to content

Commit

Permalink
fix reading of empty serialized btrees
Browse files Browse the repository at this point in the history
  • Loading branch information
antialize committed Jan 23, 2024
1 parent a0b6e32 commit da83fb4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tpie/btree/serialized_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,9 @@ class serialized_store {
metadata_size = h.metadata_size;

set_flags(h.flags);

if (m_height == 1) {
if (m_height == 0) {
root_leaf = leaf_type(0);
} else if (m_height == 1) {
root_leaf = leaf_type(h.root);
f->seekg(h.root);
unserialize(*f, *root_leaf);
Expand Down

0 comments on commit da83fb4

Please sign in to comment.