mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-19 01:18:31 +08:00
Consistently use wrapping add to avoid overflow in debug when query starts with a separator
This commit is contained in:
parent
087866d59f
commit
73198179f1
@ -77,13 +77,9 @@ pub fn located_query_terms_from_tokens(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
TokenKind::Separator(separator_kind) => {
|
TokenKind::Separator(separator_kind) => {
|
||||||
match separator_kind {
|
// add penalty for hard separators
|
||||||
SeparatorKind::Hard => {
|
if let SeparatorKind::Hard = separator_kind {
|
||||||
position += 1;
|
position = position.wrapping_add(1);
|
||||||
}
|
|
||||||
SeparatorKind::Soft => {
|
|
||||||
position += 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
phrase = 'phrase: {
|
phrase = 'phrase: {
|
||||||
|
Loading…
Reference in New Issue
Block a user