Merge pull request #143 from mingnus/thin-generate-metadata-wip
btree::remove bug fixes
This commit is contained in:
commit
7f4fa9c58a
@ -48,8 +48,10 @@ namespace {
|
||||
base::sector_t next_offset() {
|
||||
sector_t r = current_;
|
||||
current_ += block_size_;
|
||||
if (current_ > end_)
|
||||
if (current_ > end_) {
|
||||
current_ = begin_;
|
||||
return begin_;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -93,11 +93,12 @@ namespace persistent_data {
|
||||
{
|
||||
using namespace btree_detail;
|
||||
|
||||
unsigned i = 0;
|
||||
bool r = false;
|
||||
unsigned i = *index;
|
||||
|
||||
for (;;) {
|
||||
r = spine.step(block);
|
||||
bool inc = spine.step(block);
|
||||
if (inc)
|
||||
inc_children<ValueTraits>(spine, leaf_rc);
|
||||
|
||||
// patch up the parent to point to the new shadow
|
||||
if (spine.has_parent()) {
|
||||
@ -115,9 +116,9 @@ namespace persistent_data {
|
||||
return true;
|
||||
}
|
||||
|
||||
r = rebalance_children<ValueTraits>(spine, key);
|
||||
bool r = rebalance_children<ValueTraits>(spine, key);
|
||||
if (!r)
|
||||
break;
|
||||
return false;
|
||||
|
||||
n = spine.get_node<block_traits>();
|
||||
if (n.get_type() == btree_detail::LEAF) {
|
||||
@ -133,7 +134,7 @@ namespace persistent_data {
|
||||
block = n.value_at(i);
|
||||
}
|
||||
|
||||
return r;
|
||||
return true;
|
||||
}
|
||||
|
||||
template <unsigned Levels, typename _>
|
||||
|
Loading…
Reference in New Issue
Block a user