Some btree progress, implementing rbyd-tag-weight changes

This commit is contained in:
Christopher Haster
2023-04-02 00:49:00 -05:00
parent 9a1675999e
commit e5ad09b380
2 changed files with 182 additions and 198 deletions

View File

@@ -275,7 +275,7 @@ def show_log(block_size, data, rev, off, *,
# note we ignore out-of-bounds here for debugging
if delta > 0:
# grow lifetimes
i, id_ = index(weights, lower_)
i, id_ = index(weights, id-(delta-1))
if id_ > 0:
weights[i:i+1] = [id_, delta, weights[i]-id_]
lifetimes[i:i+1] = [
@@ -288,7 +288,7 @@ def show_log(block_size, data, rev, off, *,
elif delta < 0:
# shrink lifetimes
i, id_ = index(weights, lower_)
i, id_ = index(weights, id+1)
delta_ = -delta
weights_ = weights.copy()
lifetimes_ = lifetimes.copy()