mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-25 19:45:05 +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;
|
||||
|
||||
#[inline]
|
||||
fn sum_matches_attributes(matches: &Matches) -> u16 {
|
||||
fn sum_matches_attributes(matches: &Matches) -> usize {
|
||||
// note that GroupBy will never return an empty group
|
||||
// so we can do this assumption safely
|
||||
matches.query_index_groups().map(|group| {
|
||||
unsafe { group.get_unchecked(0).attribute.attribute() }
|
||||
unsafe { group.get_unchecked(0).attribute.attribute() as usize }
|
||||
}).sum()
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,11 @@ use crate::rank::criterion::Criterion;
|
||||
use crate::database::DatabaseView;
|
||||
|
||||
#[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
|
||||
// so we can do this assumption safely
|
||||
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()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user