From 3281a88d08ea7de1461658eb8fb9c1e0d3614290 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Mon, 27 Mar 2023 11:04:43 +0200 Subject: [PATCH] SmallBitmap: don't expose internal items --- milli/src/search/new/small_bitmap.rs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/milli/src/search/new/small_bitmap.rs b/milli/src/search/new/small_bitmap.rs index 24541eb6c..b1cb78c8c 100644 --- a/milli/src/search/new/small_bitmap.rs +++ b/milli/src/search/new/small_bitmap.rs @@ -31,6 +31,7 @@ impl SmallBitmap { } } } + pub fn universe_length(&self) -> u16 { match &self.internal { SmallBitmapInternal::Tiny(_) => 64, @@ -82,7 +83,7 @@ impl SmallBitmap { } } #[derive(Clone)] -pub enum SmallBitmapInternal { +enum SmallBitmapInternal { Tiny(u64), Small(Box<[u64]>), } @@ -182,11 +183,7 @@ impl SmallBitmapInternal { } } } - pub fn all_satisfy_op( - &self, - other: &SmallBitmapInternal, - op: impl Fn(u64, u64) -> bool, - ) -> bool { + fn all_satisfy_op(&self, other: &SmallBitmapInternal, op: impl Fn(u64, u64) -> bool) -> bool { match (self, other) { (SmallBitmapInternal::Tiny(a), SmallBitmapInternal::Tiny(b)) => op(*a, *b), (SmallBitmapInternal::Small(a), SmallBitmapInternal::Small(b)) => { @@ -203,11 +200,7 @@ impl SmallBitmapInternal { } } } - pub fn any_satisfy_op( - &self, - other: &SmallBitmapInternal, - op: impl Fn(u64, u64) -> bool, - ) -> bool { + fn any_satisfy_op(&self, other: &SmallBitmapInternal, op: impl Fn(u64, u64) -> bool) -> bool { match (self, other) { (SmallBitmapInternal::Tiny(a), SmallBitmapInternal::Tiny(b)) => op(*a, *b), (SmallBitmapInternal::Small(a), SmallBitmapInternal::Small(b)) => {