Skip to content

Commit 30628d3

Browse files
committed
further cleanup
1 parent 4fc9c71 commit 30628d3

File tree

5 files changed

+23
-31
lines changed

5 files changed

+23
-31
lines changed

extras/rapidfuzz_amalgamated.hpp

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
22
// SPDX-License-Identifier: MIT
33
// RapidFuzz v1.0.2
4-
// Generated: 2023-12-24 17:22:29.576990
4+
// Generated: 2023-12-24 17:28:29.475831
55
// ----------------------------------------------------------
66
// This file is an amalgamation of multiple different files.
77
// You probably shouldn't edit it directly.
@@ -1546,12 +1546,12 @@ static inline unsigned int countr_zero(uint64_t x)
15461546

15471547
static inline unsigned int countr_zero(uint16_t x)
15481548
{
1549-
return static_cast<unsigned int>(countr_zero(static_cast<uint32_t>(x)));
1549+
return countr_zero(static_cast<uint32_t>(x));
15501550
}
15511551

15521552
static inline unsigned int countr_zero(uint8_t x)
15531553
{
1554-
return static_cast<unsigned int>(countr_zero(static_cast<uint32_t>(x)));
1554+
return countr_zero(static_cast<uint32_t>(x));
15551555
}
15561556

15571557
template <class T, T... inds, class F>
@@ -8238,17 +8238,13 @@ struct MultiLevenshtein : public detail::MultiDistanceBase<MultiLevenshtein<MaxL
82388238

82398239
detail::Range scores_(scores, scores + score_count);
82408240
if constexpr (MaxLen == 8)
8241-
detail::levenshtein_hyrroe2003_simd<uint8_t>(scores_, PM, str_lens, s2,
8242-
static_cast<size_t>(score_cutoff));
8241+
detail::levenshtein_hyrroe2003_simd<uint8_t>(scores_, PM, str_lens, s2, score_cutoff);
82438242
else if constexpr (MaxLen == 16)
8244-
detail::levenshtein_hyrroe2003_simd<uint16_t>(scores_, PM, str_lens, s2,
8245-
static_cast<size_t>(score_cutoff));
8243+
detail::levenshtein_hyrroe2003_simd<uint16_t>(scores_, PM, str_lens, s2, score_cutoff);
82468244
else if constexpr (MaxLen == 32)
8247-
detail::levenshtein_hyrroe2003_simd<uint32_t>(scores_, PM, str_lens, s2,
8248-
static_cast<size_t>(score_cutoff));
8245+
detail::levenshtein_hyrroe2003_simd<uint32_t>(scores_, PM, str_lens, s2, score_cutoff);
82498246
else if constexpr (MaxLen == 64)
8250-
detail::levenshtein_hyrroe2003_simd<uint64_t>(scores_, PM, str_lens, s2,
8251-
static_cast<size_t>(score_cutoff));
8247+
detail::levenshtein_hyrroe2003_simd<uint64_t>(scores_, PM, str_lens, s2, score_cutoff);
82528248
}
82538249

82548250
template <typename InputIt2>
@@ -8600,7 +8596,7 @@ class OSA : public DistanceBase<OSA, size_t, 0, std::numeric_limits<int64_t>::ma
86008596

86018597
remove_common_affix(s1, s2);
86028598
if (s1.empty())
8603-
return (s2.size() <= static_cast<size_t>(score_cutoff)) ? s2.size() : score_cutoff + 1;
8599+
return (s2.size() <= score_cutoff) ? s2.size() : score_cutoff + 1;
86048600
else if (s1.size() < 64)
86058601
return osa_hyrroe2003(PatternMatchVector(s1), s1, s2, score_cutoff);
86068602
else
@@ -8804,17 +8800,13 @@ struct MultiOSA
88048800

88058801
detail::Range scores_(scores, scores + score_count);
88068802
if constexpr (MaxLen == 8)
8807-
detail::osa_hyrroe2003_simd<uint8_t>(scores_, PM, str_lens, s2,
8808-
static_cast<size_t>(score_cutoff));
8803+
detail::osa_hyrroe2003_simd<uint8_t>(scores_, PM, str_lens, s2, score_cutoff);
88098804
else if constexpr (MaxLen == 16)
8810-
detail::osa_hyrroe2003_simd<uint16_t>(scores_, PM, str_lens, s2,
8811-
static_cast<size_t>(score_cutoff));
8805+
detail::osa_hyrroe2003_simd<uint16_t>(scores_, PM, str_lens, s2, score_cutoff);
88128806
else if constexpr (MaxLen == 32)
8813-
detail::osa_hyrroe2003_simd<uint32_t>(scores_, PM, str_lens, s2,
8814-
static_cast<size_t>(score_cutoff));
8807+
detail::osa_hyrroe2003_simd<uint32_t>(scores_, PM, str_lens, s2, score_cutoff);
88158808
else if constexpr (MaxLen == 64)
8816-
detail::osa_hyrroe2003_simd<uint64_t>(scores_, PM, str_lens, s2,
8817-
static_cast<size_t>(score_cutoff));
8809+
detail::osa_hyrroe2003_simd<uint64_t>(scores_, PM, str_lens, s2, score_cutoff);
88188810
}
88198811

88208812
template <typename InputIt2>

rapidfuzz/details/intrinsics.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,12 @@ static inline unsigned int countr_zero(uint64_t x)
189189

190190
static inline unsigned int countr_zero(uint16_t x)
191191
{
192-
return static_cast<unsigned int>(countr_zero(static_cast<uint32_t>(x)));
192+
return countr_zero(static_cast<uint32_t>(x));
193193
}
194194

195195
static inline unsigned int countr_zero(uint8_t x)
196196
{
197-
return static_cast<unsigned int>(countr_zero(static_cast<uint32_t>(x)));
197+
return countr_zero(static_cast<uint32_t>(x));
198198
}
199199

200200
template <class T, T... inds, class F>

rapidfuzz/distance/Levenshtein.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,16 +390,16 @@ struct MultiLevenshtein : public detail::MultiDistanceBase<MultiLevenshtein<MaxL
390390
detail::Range scores_(scores, scores + score_count);
391391
if constexpr (MaxLen == 8)
392392
detail::levenshtein_hyrroe2003_simd<uint8_t>(scores_, PM, str_lens, s2,
393-
static_cast<size_t>(score_cutoff));
393+
score_cutoff);
394394
else if constexpr (MaxLen == 16)
395395
detail::levenshtein_hyrroe2003_simd<uint16_t>(scores_, PM, str_lens, s2,
396-
static_cast<size_t>(score_cutoff));
396+
score_cutoff);
397397
else if constexpr (MaxLen == 32)
398398
detail::levenshtein_hyrroe2003_simd<uint32_t>(scores_, PM, str_lens, s2,
399-
static_cast<size_t>(score_cutoff));
399+
score_cutoff);
400400
else if constexpr (MaxLen == 64)
401401
detail::levenshtein_hyrroe2003_simd<uint64_t>(scores_, PM, str_lens, s2,
402-
static_cast<size_t>(score_cutoff));
402+
score_cutoff);
403403
}
404404

405405
template <typename InputIt2>

rapidfuzz/distance/OSA.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,16 +202,16 @@ struct MultiOSA
202202
detail::Range scores_(scores, scores + score_count);
203203
if constexpr (MaxLen == 8)
204204
detail::osa_hyrroe2003_simd<uint8_t>(scores_, PM, str_lens, s2,
205-
static_cast<size_t>(score_cutoff));
205+
score_cutoff);
206206
else if constexpr (MaxLen == 16)
207207
detail::osa_hyrroe2003_simd<uint16_t>(scores_, PM, str_lens, s2,
208-
static_cast<size_t>(score_cutoff));
208+
score_cutoff);
209209
else if constexpr (MaxLen == 32)
210210
detail::osa_hyrroe2003_simd<uint32_t>(scores_, PM, str_lens, s2,
211-
static_cast<size_t>(score_cutoff));
211+
score_cutoff);
212212
else if constexpr (MaxLen == 64)
213213
detail::osa_hyrroe2003_simd<uint64_t>(scores_, PM, str_lens, s2,
214-
static_cast<size_t>(score_cutoff));
214+
score_cutoff);
215215
}
216216

217217
template <typename InputIt2>

rapidfuzz/distance/OSA_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ class OSA : public DistanceBase<OSA, size_t, 0, std::numeric_limits<int64_t>::ma
262262

263263
remove_common_affix(s1, s2);
264264
if (s1.empty())
265-
return (s2.size() <= static_cast<size_t>(score_cutoff)) ? s2.size() : score_cutoff + 1;
265+
return (s2.size() <= score_cutoff) ? s2.size() : score_cutoff + 1;
266266
else if (s1.size() < 64)
267267
return osa_hyrroe2003(PatternMatchVector(s1), s1, s2, score_cutoff);
268268
else

0 commit comments

Comments
 (0)