Skip to content

Commit

Permalink
compaction: define the variable just before it used (tikv#130)
Browse files Browse the repository at this point in the history
Signed-off-by: zhangjinpeng1987 <[email protected]>
  • Loading branch information
zhangjinpeng87 committed May 31, 2022
1 parent 9a95076 commit 75999d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/levels/compaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,14 @@ impl CompactStatus {
this_level < self.levels.len() - 1,
"compaction on invalid level"
);

let next_level = compact_def.next_level_id;
if self.levels[this_level].overlaps_with(&compact_def.this_range) {
return Err(Error::CompactionError(format!(
"{:?} overlap with this level {} {:?}",
compact_def.this_range, compact_def.this_level_id, self.levels[this_level].ranges
)));
}

let next_level = compact_def.next_level_id;
if self.levels[next_level].overlaps_with(&compact_def.next_range) {
return Err(Error::CompactionError(format!(
"{:?} overlap with next level {} {:?}",
Expand Down

0 comments on commit 75999d1

Please sign in to comment.