@@ -354,7 +354,7 @@ impl<'a> Dictionary<'a> {
354
354
// Finding best entry to merge-in the new value
355
355
// TODO Optimize the case when at least threshold bits_set
356
356
if let Some ( ( key, value, _) ) = self . map
357
- . range_mut ( Excluded ( & lower_bound) , Included ( & pending_key) )
357
+ . range_mut ( ( Excluded ( & lower_bound) , Included ( & pending_key) ) )
358
358
. map ( |( k, v) | ( k, v, k. 0 . fuzzy_eq ( & pending_key. 0 ) ) )
359
359
. filter ( |& ( _, _, m) | m >= bit_threshold)
360
360
. max_by ( |x, y| x. 2 . cmp ( & y. 2 ) ) // max by matched_bits
@@ -409,7 +409,7 @@ impl<'a> Dictionary<'a> {
409
409
let bit_threshold = ( key. 0 . bits_set as f32 / 100. * similarity as f32 ) . round ( ) as usize ;
410
410
411
411
if let Some ( ( _, value, _) ) = self . map
412
- . range ( Excluded ( & lower_bound) , Included ( & key) )
412
+ . range ( ( Excluded ( & lower_bound) , Included ( key) ) )
413
413
. map ( |( k, v) | ( k, v, k. 0 . fuzzy_eq ( & key. 0 ) ) )
414
414
. filter ( |& ( _, _, m) | m >= bit_threshold)
415
415
. max_by ( |x, y| x. 2 . cmp ( & y. 2 ) ) // max by matched_bits
0 commit comments