This commit is contained in:
Paul Masurel
2022-12-21 15:43:34 +09:00
parent 2ac1cc2fc0
commit 4a6bf50e78
3 changed files with 4 additions and 7 deletions

View File

@@ -101,7 +101,7 @@ impl BitUnpacker {
.try_into()
.unwrap();
let val_unshifted_unmasked: u64 = u64::from_le_bytes(bytes);
let val_shifted = (val_unshifted_unmasked >> bit_shift);
let val_shifted = val_unshifted_unmasked >> bit_shift;
val_shifted & self.mask
}
}

View File

@@ -160,7 +160,7 @@ fn deserialize_sparse_codec_block(data: &OwnedBytes) -> Vec<SparseCodecBlockVari
// The number of vals so far
let mut offset = 0;
let mut sparse_codec_blocks = Vec::new();
let num_blocks = get_u16(&data, data.len() - 2);
let num_blocks = get_u16(data, data.len() - 2);
let block_data_index_start =
data.len() - 2 - num_blocks as usize * SERIALIZED_BLOCK_METADATA_SIZE;
let mut byte_start = 0;

View File

@@ -126,7 +126,7 @@ impl VecCursor {
}
#[inline]
fn current(&self) -> Option<u32> {
self.docs.get(self.current_pos).map(|el| *el)
self.docs.get(self.current_pos).copied()
}
fn get_cleared_data(&mut self) -> &mut Vec<u32> {
self.docs.clear();
@@ -280,10 +280,7 @@ impl DocSet for IpRangeDocSet {
#[inline]
fn doc(&self) -> DocId {
self.loaded_docs
.current()
.map(|el| el)
.unwrap_or(TERMINATED)
self.loaded_docs.current().unwrap_or(TERMINATED)
}
/// Advances the `DocSet` forward until reaching the target, or going to the