mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-30 00:34:26 +01:00
SmallBitmap: don't expose internal items
This commit is contained in:
parent
5a644054ab
commit
3281a88d08
@ -31,6 +31,7 @@ impl<T> SmallBitmap<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn universe_length(&self) -> u16 {
|
pub fn universe_length(&self) -> u16 {
|
||||||
match &self.internal {
|
match &self.internal {
|
||||||
SmallBitmapInternal::Tiny(_) => 64,
|
SmallBitmapInternal::Tiny(_) => 64,
|
||||||
@ -82,7 +83,7 @@ impl<T> SmallBitmap<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub enum SmallBitmapInternal {
|
enum SmallBitmapInternal {
|
||||||
Tiny(u64),
|
Tiny(u64),
|
||||||
Small(Box<[u64]>),
|
Small(Box<[u64]>),
|
||||||
}
|
}
|
||||||
@ -182,11 +183,7 @@ impl SmallBitmapInternal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn all_satisfy_op(
|
fn all_satisfy_op(&self, other: &SmallBitmapInternal, op: impl Fn(u64, u64) -> bool) -> bool {
|
||||||
&self,
|
|
||||||
other: &SmallBitmapInternal,
|
|
||||||
op: impl Fn(u64, u64) -> bool,
|
|
||||||
) -> bool {
|
|
||||||
match (self, other) {
|
match (self, other) {
|
||||||
(SmallBitmapInternal::Tiny(a), SmallBitmapInternal::Tiny(b)) => op(*a, *b),
|
(SmallBitmapInternal::Tiny(a), SmallBitmapInternal::Tiny(b)) => op(*a, *b),
|
||||||
(SmallBitmapInternal::Small(a), SmallBitmapInternal::Small(b)) => {
|
(SmallBitmapInternal::Small(a), SmallBitmapInternal::Small(b)) => {
|
||||||
@ -203,11 +200,7 @@ impl SmallBitmapInternal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn any_satisfy_op(
|
fn any_satisfy_op(&self, other: &SmallBitmapInternal, op: impl Fn(u64, u64) -> bool) -> bool {
|
||||||
&self,
|
|
||||||
other: &SmallBitmapInternal,
|
|
||||||
op: impl Fn(u64, u64) -> bool,
|
|
||||||
) -> bool {
|
|
||||||
match (self, other) {
|
match (self, other) {
|
||||||
(SmallBitmapInternal::Tiny(a), SmallBitmapInternal::Tiny(b)) => op(*a, *b),
|
(SmallBitmapInternal::Tiny(a), SmallBitmapInternal::Tiny(b)) => op(*a, *b),
|
||||||
(SmallBitmapInternal::Small(a), SmallBitmapInternal::Small(b)) => {
|
(SmallBitmapInternal::Small(a), SmallBitmapInternal::Small(b)) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user