Skip to content

Commit

Permalink
fix capacity of level ssts
Browse files Browse the repository at this point in the history
  • Loading branch information
letterbeezps committed Mar 9, 2024
1 parent db10260 commit 48b672a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mini-lsm-mvcc/src/lsm_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ impl LsmStorageInner {
let l0_iter = MergeIterator::create(l0_iters);
let mut level_iters = Vec::with_capacity(snapshot.levels.len());
for (_, level_sst_ids) in &snapshot.levels {
let mut level_ssts = Vec::with_capacity(snapshot.levels[0].1.len());
let mut level_ssts = Vec::with_capacity(level_sst_ids.len());
for table in level_sst_ids {
let table = snapshot.sstables[table].clone();
if keep_table(key, &table) {
Expand Down
2 changes: 1 addition & 1 deletion mini-lsm/src/lsm_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ impl LsmStorageInner {
let l0_iter = MergeIterator::create(l0_iters);
let mut level_iters = Vec::with_capacity(snapshot.levels.len());
for (_, level_sst_ids) in &snapshot.levels {
let mut level_ssts = Vec::with_capacity(snapshot.levels[0].1.len());
let mut level_ssts = Vec::with_capacity(level_sst_ids.len());
for table in level_sst_ids {
let table = snapshot.sstables[table].clone();
if keep_table(key, &table) {
Expand Down

0 comments on commit 48b672a

Please sign in to comment.