@@ -139,34 +139,34 @@ namespace rapidfuzz {
139139 */
140140template <typename InputIt1, typename InputIt2>
141141size_t levenshtein_distance (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2,
142- LevenshteinWeightTable weights = {1 , 1 , 1 },
143- size_t score_cutoff = std::numeric_limits<size_t >::max(),
144- size_t score_hint = std::numeric_limits<size_t>::max())
142+ LevenshteinWeightTable weights = {1 , 1 , 1 },
143+ size_t score_cutoff = std::numeric_limits<size_t >::max(),
144+ size_t score_hint = std::numeric_limits<size_t>::max())
145145{
146146 return detail::Levenshtein::distance (first1, last1, first2, last2, weights, score_cutoff, score_hint);
147147}
148148
149149template <typename Sentence1, typename Sentence2>
150150size_t levenshtein_distance (const Sentence1& s1, const Sentence2& s2,
151- LevenshteinWeightTable weights = {1 , 1 , 1 },
152- size_t score_cutoff = std::numeric_limits<size_t >::max(),
153- size_t score_hint = std::numeric_limits<size_t>::max())
151+ LevenshteinWeightTable weights = {1 , 1 , 1 },
152+ size_t score_cutoff = std::numeric_limits<size_t >::max(),
153+ size_t score_hint = std::numeric_limits<size_t>::max())
154154{
155155 return detail::Levenshtein::distance (s1, s2, weights, score_cutoff, score_hint);
156156}
157157
158158template <typename InputIt1, typename InputIt2>
159159size_t levenshtein_similarity (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2,
160- LevenshteinWeightTable weights = {1 , 1 , 1 }, size_t score_cutoff = 0 ,
161- size_t score_hint = 0 )
160+ LevenshteinWeightTable weights = {1 , 1 , 1 }, size_t score_cutoff = 0 ,
161+ size_t score_hint = 0 )
162162{
163163 return detail::Levenshtein::similarity (first1, last1, first2, last2, weights, score_cutoff, score_hint);
164164}
165165
166166template <typename Sentence1, typename Sentence2>
167167size_t levenshtein_similarity (const Sentence1& s1, const Sentence2& s2,
168- LevenshteinWeightTable weights = {1 , 1 , 1 }, size_t score_cutoff = 0 ,
169- size_t score_hint = 0 )
168+ LevenshteinWeightTable weights = {1 , 1 , 1 }, size_t score_cutoff = 0 ,
169+ size_t score_hint = 0 )
170170{
171171 return detail::Levenshtein::similarity (s1, s2, weights, score_cutoff, score_hint);
172172}
@@ -389,17 +389,13 @@ struct MultiLevenshtein : public detail::MultiDistanceBase<MultiLevenshtein<MaxL
389389
390390 detail::Range scores_ (scores, scores + score_count);
391391 if constexpr (MaxLen == 8 )
392- detail::levenshtein_hyrroe2003_simd<uint8_t >(scores_, PM, str_lens, s2,
393- score_cutoff);
392+ detail::levenshtein_hyrroe2003_simd<uint8_t >(scores_, PM, str_lens, s2, score_cutoff);
394393 else if constexpr (MaxLen == 16 )
395- detail::levenshtein_hyrroe2003_simd<uint16_t >(scores_, PM, str_lens, s2,
396- score_cutoff);
394+ detail::levenshtein_hyrroe2003_simd<uint16_t >(scores_, PM, str_lens, s2, score_cutoff);
397395 else if constexpr (MaxLen == 32 )
398- detail::levenshtein_hyrroe2003_simd<uint32_t >(scores_, PM, str_lens, s2,
399- score_cutoff);
396+ detail::levenshtein_hyrroe2003_simd<uint32_t >(scores_, PM, str_lens, s2, score_cutoff);
400397 else if constexpr (MaxLen == 64 )
401- detail::levenshtein_hyrroe2003_simd<uint64_t >(scores_, PM, str_lens, s2,
402- score_cutoff);
398+ detail::levenshtein_hyrroe2003_simd<uint64_t >(scores_, PM, str_lens, s2, score_cutoff);
403399 }
404400
405401 template <typename InputIt2>
@@ -458,9 +454,8 @@ struct CachedLevenshtein : public detail::CachedDistanceBase<CachedLevenshtein<C
458454 // max can make use of the common divisor of the three weights
459455 size_t new_score_cutoff = detail::ceil_div (score_cutoff, weights.insert_cost );
460456 size_t new_score_hint = detail::ceil_div (score_hint, weights.insert_cost );
461- size_t dist = detail::uniform_levenshtein_distance (
462- PM, detail::Range (s1), s2, new_score_cutoff,
463- new_score_hint);
457+ size_t dist = detail::uniform_levenshtein_distance (PM, detail::Range (s1), s2,
458+ new_score_cutoff, new_score_hint);
464459 dist *= weights.insert_cost ;
465460
466461 return (dist <= score_cutoff) ? dist : score_cutoff + 1 ;
@@ -478,8 +473,7 @@ struct CachedLevenshtein : public detail::CachedDistanceBase<CachedLevenshtein<C
478473 }
479474 }
480475
481- return detail::generalized_levenshtein_distance (
482- detail::Range (s1), s2, weights, score_cutoff);
476+ return detail::generalized_levenshtein_distance (detail::Range (s1), s2, weights, score_cutoff);
483477 }
484478
485479 std::vector<CharT1> s1;
0 commit comments