refactor(compact): add BlockCompactThresholds::check_large_enough.
@@ -32,13 +32,14 @@ impl BlockCompactThresholds {
}
}
+ #[inline]
pub fn check_perfect_block(&self, row_count: usize, block_size: usize) -> bool {
- if row_count <= self.max_rows_per_block
- && (row_count >= self.min_rows_per_block || block_size >= self.max_bytes_per_block)
- {
- return true;
+ row_count <= self.max_rows_per_block && self.check_large_enough(row_count, block_size)
}
- false
+
+ #[inline]
+ pub fn check_large_enough(&self, row_count: usize, block_size: usize) -> bool {
+ row_count >= self.min_rows_per_block || block_size >= self.max_bytes_per_block
}
pub fn check_for_recluster(&self, total_rows: usize, total_bytes: usize) -> bool {
