Skip to content

Commit

Permalink
chore: remove unnecessary temporary hitmap
Browse files Browse the repository at this point in the history
Signed-off-by: MrCroxx <[email protected]>
  • Loading branch information
MrCroxx committed Jan 25, 2024
1 parent c839d4a commit d2532ea
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/storage/src/hummock/sstable/block_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,6 @@ impl BlockIterator {

/// Searches the restart point index that the given `key` belongs to.
fn search_restart_point_index_by_key(&mut self, key: FullKey<&[u8]>) -> usize {
// Create a temporary local hitmap.
let mut hitmap = LocalHitmap::default();

// Find the largest restart point that restart key equals or less than the given key.
let res = self
.block
Expand All @@ -269,13 +266,18 @@ impl BlockIterator {
key_len_type,
value_len_type,
}| {
let prefix =
self.decode_prefix_at(probe as usize, key_len_type, value_len_type);
let probe = probe as usize;
let prefix = KeyPrefix::decode(
&mut &self.block.data()[probe..],
probe,
key_len_type,
value_len_type,
);
let probe_key = &self.block.data()[prefix.diff_key_range()];
let full_probe_key =
FullKey::from_slice_without_table_id(self.block.table_id(), probe_key);
hitmap.fill_with_range(
probe as usize,
self.hitmap.fill_with_range(
probe,
prefix.diff_key_range().end,
self.block.len(),
);
Expand All @@ -288,8 +290,6 @@ impl BlockIterator {
// Prevent from underflowing when given is smaller than the first.
.saturating_sub(1);

self.hitmap.merge(&mut hitmap);

res
}

Expand Down

0 comments on commit d2532ea

Please sign in to comment.