diff --git a/master/src/tantivy/compression/mod.rs.html b/master/src/tantivy/compression/mod.rs.html index cf5c6ca54..25c54c66b 100644 --- a/master/src/tantivy/compression/mod.rs.html +++ b/master/src/tantivy/compression/mod.rs.html @@ -322,10 +322,6 @@ 266 267 268 -269 -270 -271 -272
#![allow(dead_code)] @@ -336,8 +332,9 @@ pub const COMPRESSION_BLOCK_SIZE: usize = 128; -pub(crate) fn compute_block_size(num_bits: u8) -> usize { - 1 + (num_bits as usize * COMPRESSION_BLOCK_SIZE + 7) / 8 +/// Returns the size in bytes of a compressed block, given `num_bits`. +pub fn compressed_block_size(num_bits: u8) -> usize { + 1 + (num_bits as usize) * 16 } #[cfg(not(feature = "simdcompression"))] @@ -366,11 +363,6 @@ pub(crate) use self::compression_vint_simd::*; } -/// Returns the size in bytes of a compressed block, given `num_bits`. -pub fn compressed_block_size(num_bits: u8) -> usize { - 1 + (num_bits as usize) * 16 -} - pub trait VIntEncoder { /// Compresses an array of `u32` integers, /// using [delta-encoding](https://en.wikipedia.org/wiki/Delta_encoding) diff --git a/master/src/tantivy/compression/pack/compression_pack_simd.rs.html b/master/src/tantivy/compression/pack/compression_pack_simd.rs.html index c79f097c0..9c962ff76 100644 --- a/master/src/tantivy/compression/pack/compression_pack_simd.rs.html +++ b/master/src/tantivy/compression/pack/compression_pack_simd.rs.html @@ -170,10 +170,8 @@ 114 115 116 -117 -118
-use super::super::{compute_block_size, COMPRESSION_BLOCK_SIZE}; +use compression::COMPRESSION_BLOCK_SIZE; const COMPRESSED_BLOCK_MAX_SIZE: usize = COMPRESSION_BLOCK_SIZE * 4 + 1; @@ -226,13 +224,11 @@ pub fn compress_block_sorted(&mut self, vals: &[u32], offset: u32) -> &[u8] { let compressed_size = compress_sorted(vals, &mut self.output, offset); - assert_eq!(compressed_size, compute_block_size(self.output[0])); &self.output[..compressed_size] } pub fn compress_block_unsorted(&mut self, vals: &[u32]) -> &[u8] { let compressed_size = compress_unsorted(vals, &mut self.output); - assert_eq!(compressed_size, compute_block_size(self.output[0])); &self.output[..compressed_size] } } diff --git a/master/src/tantivy/postings/segment_postings.rs.html b/master/src/tantivy/postings/segment_postings.rs.html index c9155b6cd..c93d72166 100644 --- a/master/src/tantivy/postings/segment_postings.rs.html +++ b/master/src/tantivy/postings/segment_postings.rs.html @@ -665,7 +665,7 @@ use docset::{DocSet, SkipResult}; use std::cmp; use fst::Streamer; -use compression::compute_block_size; +use compression::compressed_block_size; use fastfield::DeleteBitSet; use std::cell::UnsafeCell; use directory::{ReadOnlySource, SourceRead}; @@ -1094,7 +1094,7 @@ match self.freq_reading_option { FreqReadingOption::NoFreq => {} FreqReadingOption::SkipFreq => { - let num_bytes_to_skip = compute_block_size(self.remaining_data.as_ref()[0]); + let num_bytes_to_skip = compressed_block_size(self.remaining_data.as_ref()[0]); self.remaining_data.advance(num_bytes_to_skip); } FreqReadingOption::ReadFreq => {