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