Skip to content

Commit

Permalink
level: fix index in move_l0_to_front
Browse files Browse the repository at this point in the history
Signed-off-by: Tianion <[email protected]>
  • Loading branch information
Tianion committed Feb 21, 2023
1 parent 070ff80 commit 8bfa644
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1003,8 +1003,8 @@ impl LevelsController {
|prios: Vec<CompactionPriority>| match prios.iter().position(|x| x.level == 0) {
Some(pos) => {
let mut result = vec![prios[pos].clone()];
result.extend_from_slice(&prios[..idx]);
result.extend_from_slice(&prios[idx + 1..]);
result.extend_from_slice(&prios[..pos]);
result.extend_from_slice(&prios[pos + 1..]);
result
}
_ => prios,
Expand Down

0 comments on commit 8bfa644

Please sign in to comment.