Skip to content

Commit

Permalink
fix: fix unneccessary copy in block decode (#14786)
Browse files Browse the repository at this point in the history
  • Loading branch information
hzxa21 authored Jan 25, 2024
1 parent df87c2d commit 2559b23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/storage/src/hummock/sstable/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ impl Block {
let buf = match compression {
CompressionAlgorithm::None => {
if copy {
buf.slice(0..(buf.len() - 9))
} else {
Bytes::copy_from_slice(&buf[0..(buf.len() - 9)])
} else {
buf.slice(0..(buf.len() - 9))
}
}
CompressionAlgorithm::Lz4 => {
Expand Down

0 comments on commit 2559b23

Please sign in to comment.