mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 03:55:07 +08:00
feat: Sum usizes instead of little u16/u32
This commit is contained in:
parent
d899b86603
commit
c74caa0f82
@ -8,11 +8,11 @@ use crate::database::DatabaseView;
|
|||||||
use crate::rank::criterion::Criterion;
|
use crate::rank::criterion::Criterion;
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn sum_matches_attributes(matches: &Matches) -> u16 {
|
fn sum_matches_attributes(matches: &Matches) -> usize {
|
||||||
// note that GroupBy will never return an empty group
|
// note that GroupBy will never return an empty group
|
||||||
// so we can do this assumption safely
|
// so we can do this assumption safely
|
||||||
matches.query_index_groups().map(|group| {
|
matches.query_index_groups().map(|group| {
|
||||||
unsafe { group.get_unchecked(0).attribute.attribute() }
|
unsafe { group.get_unchecked(0).attribute.attribute() as usize }
|
||||||
}).sum()
|
}).sum()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,11 +8,11 @@ use crate::rank::criterion::Criterion;
|
|||||||
use crate::database::DatabaseView;
|
use crate::database::DatabaseView;
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn sum_matches_attribute_index(matches: &Matches) -> u32 {
|
fn sum_matches_attribute_index(matches: &Matches) -> usize {
|
||||||
// note that GroupBy will never return an empty group
|
// note that GroupBy will never return an empty group
|
||||||
// so we can do this assumption safely
|
// so we can do this assumption safely
|
||||||
matches.query_index_groups().map(|group| {
|
matches.query_index_groups().map(|group| {
|
||||||
unsafe { group.get_unchecked(0).attribute.word_index() }
|
unsafe { group.get_unchecked(0).attribute.word_index() as usize }
|
||||||
}).sum()
|
}).sum()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user