Skip to content

Commit 3b9bd06

Browse files
committed
mark more template functions as static inline
1 parent 90e8ce3 commit 3b9bd06

2 files changed

Lines changed: 24 additions & 22 deletions

File tree

extras/rapidfuzz_amalgamated.hpp

Lines changed: 16 additions & 14 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-10-21 19:41:24.603454
4+
// Generated: 2023-10-28 05:15:10.035216
55
// ----------------------------------------------------------
66
// This file is an amalgamation of multiple different files.
77
// You probably shouldn't edit it directly.
@@ -5341,8 +5341,9 @@ static inline size_t count_common_chars(const FlaggedCharsMultiword& flagged)
53415341
}
53425342

53435343
template <typename PM_Vec, typename InputIt1, typename InputIt2>
5344-
FlaggedCharsWord flag_similar_characters_word(const PM_Vec& PM, [[maybe_unused]] Range<InputIt1> P,
5345-
Range<InputIt2> T, int Bound)
5344+
static inline FlaggedCharsWord flag_similar_characters_word(const PM_Vec& PM,
5345+
[[maybe_unused]] Range<InputIt1> P,
5346+
Range<InputIt2> T, int Bound)
53465347
{
53475348
assert(P.size() <= 64);
53485349
assert(T.size() <= 64);
@@ -5376,8 +5377,9 @@ FlaggedCharsWord flag_similar_characters_word(const PM_Vec& PM, [[maybe_unused]]
53765377
}
53775378

53785379
template <typename CharT>
5379-
void flag_similar_characters_step(const BlockPatternMatchVector& PM, CharT T_j,
5380-
FlaggedCharsMultiword& flagged, size_t j, SearchBoundMask BoundMask)
5380+
static inline void flag_similar_characters_step(const BlockPatternMatchVector& PM, CharT T_j,
5381+
FlaggedCharsMultiword& flagged, size_t j,
5382+
SearchBoundMask BoundMask)
53815383
{
53825384
size_t j_word = j / 64;
53835385
size_t j_pos = j % 64;
@@ -5575,7 +5577,7 @@ static inline int64_t jaro_bounds(int64_t P_len, int64_t T_len)
55755577
* @brief find bounds and skip out of bound parts of the sequences
55765578
*/
55775579
template <typename InputIt1, typename InputIt2>
5578-
int64_t jaro_bounds(Range<InputIt1>& P, Range<InputIt2>& T)
5580+
static inline int64_t jaro_bounds(Range<InputIt1>& P, Range<InputIt2>& T)
55795581
{
55805582
int64_t P_len = P.size();
55815583
int64_t T_len = T.size();
@@ -5600,7 +5602,7 @@ int64_t jaro_bounds(Range<InputIt1>& P, Range<InputIt2>& T)
56005602
}
56015603

56025604
template <typename InputIt1, typename InputIt2>
5603-
double jaro_similarity(Range<InputIt1> P, Range<InputIt2> T, double score_cutoff)
5605+
static inline double jaro_similarity(Range<InputIt1> P, Range<InputIt2> T, double score_cutoff)
56045606
{
56055607
int64_t P_len = P.size();
56065608
int64_t T_len = T.size();
@@ -5648,8 +5650,8 @@ double jaro_similarity(Range<InputIt1> P, Range<InputIt2> T, double score_cutoff
56485650
}
56495651

56505652
template <typename InputIt1, typename InputIt2>
5651-
double jaro_similarity(const BlockPatternMatchVector& PM, Range<InputIt1> P, Range<InputIt2> T,
5652-
double score_cutoff)
5653+
static inline double jaro_similarity(const BlockPatternMatchVector& PM, Range<InputIt1> P, Range<InputIt2> T,
5654+
double score_cutoff)
56535655
{
56545656
int64_t P_len = P.size();
56555657
int64_t T_len = T.size();
@@ -5705,7 +5707,7 @@ struct JaroSimilaritySimdBounds {
57055707

57065708
# ifdef RAPIDFUZZ_AVX2
57075709
template <typename VecType, typename InputIt, int _lto_hack = RAPIDFUZZ_LTO_HACK>
5708-
auto jaro_similarity_prepare_bound(const VecType* s1_lengths, Range<InputIt>& s2)
5710+
static inline auto jaro_similarity_prepare_bound(const VecType* s1_lengths, Range<InputIt>& s2)
57095711
{
57105712
using namespace simd_avx2;
57115713

@@ -5763,7 +5765,7 @@ auto jaro_similarity_prepare_bound(const VecType* s1_lengths, Range<InputIt>& s2
57635765
}
57645766
# else
57655767
template <typename VecType, typename InputIt, int _lto_hack = RAPIDFUZZ_LTO_HACK>
5766-
auto jaro_similarity_prepare_bound(const VecType* s1_lengths, Range<InputIt>& s2)
5768+
static inline auto jaro_similarity_prepare_bound(const VecType* s1_lengths, Range<InputIt>& s2)
57675769
{
57685770
using namespace simd_sse2;
57695771

@@ -5807,9 +5809,9 @@ auto jaro_similarity_prepare_bound(const VecType* s1_lengths, Range<InputIt>& s2
58075809
# endif
58085810

58095811
template <typename VecType, typename InputIt, int _lto_hack = RAPIDFUZZ_LTO_HACK>
5810-
void jaro_similarity_simd(Range<double*> scores, const detail::BlockPatternMatchVector& block,
5811-
VecType* s1_lengths, size_t s1_lengths_size, Range<InputIt> s2,
5812-
double score_cutoff) noexcept
5812+
static inline void jaro_similarity_simd(Range<double*> scores, const detail::BlockPatternMatchVector& block,
5813+
VecType* s1_lengths, size_t s1_lengths_size, Range<InputIt> s2,
5814+
double score_cutoff) noexcept
58135815
{
58145816
# ifdef RAPIDFUZZ_AVX2
58155817
using namespace simd_avx2;

rapidfuzz/distance/Jaro_impl.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static inline size_t count_common_chars(const FlaggedCharsMultiword& flagged)
100100
}
101101

102102
template <typename PM_Vec, typename InputIt1, typename InputIt2>
103-
FlaggedCharsWord flag_similar_characters_word(const PM_Vec& PM, [[maybe_unused]] Range<InputIt1> P,
103+
static inline FlaggedCharsWord flag_similar_characters_word(const PM_Vec& PM, [[maybe_unused]] Range<InputIt1> P,
104104
Range<InputIt2> T, int Bound)
105105
{
106106
assert(P.size() <= 64);
@@ -135,7 +135,7 @@ FlaggedCharsWord flag_similar_characters_word(const PM_Vec& PM, [[maybe_unused]]
135135
}
136136

137137
template <typename CharT>
138-
void flag_similar_characters_step(const BlockPatternMatchVector& PM, CharT T_j,
138+
static inline void flag_similar_characters_step(const BlockPatternMatchVector& PM, CharT T_j,
139139
FlaggedCharsMultiword& flagged, size_t j, SearchBoundMask BoundMask)
140140
{
141141
size_t j_word = j / 64;
@@ -335,7 +335,7 @@ static inline int64_t jaro_bounds(int64_t P_len, int64_t T_len)
335335
* @brief find bounds and skip out of bound parts of the sequences
336336
*/
337337
template <typename InputIt1, typename InputIt2>
338-
int64_t jaro_bounds(Range<InputIt1>& P, Range<InputIt2>& T)
338+
static inline int64_t jaro_bounds(Range<InputIt1>& P, Range<InputIt2>& T)
339339
{
340340
int64_t P_len = P.size();
341341
int64_t T_len = T.size();
@@ -360,7 +360,7 @@ int64_t jaro_bounds(Range<InputIt1>& P, Range<InputIt2>& T)
360360
}
361361

362362
template <typename InputIt1, typename InputIt2>
363-
double jaro_similarity(Range<InputIt1> P, Range<InputIt2> T, double score_cutoff)
363+
static inline double jaro_similarity(Range<InputIt1> P, Range<InputIt2> T, double score_cutoff)
364364
{
365365
int64_t P_len = P.size();
366366
int64_t T_len = T.size();
@@ -408,7 +408,7 @@ double jaro_similarity(Range<InputIt1> P, Range<InputIt2> T, double score_cutoff
408408
}
409409

410410
template <typename InputIt1, typename InputIt2>
411-
double jaro_similarity(const BlockPatternMatchVector& PM, Range<InputIt1> P, Range<InputIt2> T,
411+
static inline double jaro_similarity(const BlockPatternMatchVector& PM, Range<InputIt1> P, Range<InputIt2> T,
412412
double score_cutoff)
413413
{
414414
int64_t P_len = P.size();
@@ -466,7 +466,7 @@ struct JaroSimilaritySimdBounds
466466

467467
#ifdef RAPIDFUZZ_AVX2
468468
template <typename VecType, typename InputIt, int _lto_hack = RAPIDFUZZ_LTO_HACK>
469-
auto jaro_similarity_prepare_bound(const VecType* s1_lengths, Range<InputIt>& s2)
469+
static inline auto jaro_similarity_prepare_bound(const VecType* s1_lengths, Range<InputIt>& s2)
470470
{
471471
using namespace simd_avx2;
472472

@@ -526,7 +526,7 @@ auto jaro_similarity_prepare_bound(const VecType* s1_lengths, Range<InputIt>& s2
526526
}
527527
#else
528528
template <typename VecType, typename InputIt, int _lto_hack = RAPIDFUZZ_LTO_HACK>
529-
auto jaro_similarity_prepare_bound(const VecType* s1_lengths, Range<InputIt>& s2)
529+
static inline auto jaro_similarity_prepare_bound(const VecType* s1_lengths, Range<InputIt>& s2)
530530
{
531531
using namespace simd_sse2;
532532

@@ -571,7 +571,7 @@ auto jaro_similarity_prepare_bound(const VecType* s1_lengths, Range<InputIt>& s2
571571
#endif
572572

573573
template <typename VecType, typename InputIt, int _lto_hack = RAPIDFUZZ_LTO_HACK>
574-
void jaro_similarity_simd(Range<double*> scores, const detail::BlockPatternMatchVector& block,
574+
static inline void jaro_similarity_simd(Range<double*> scores, const detail::BlockPatternMatchVector& block,
575575
VecType* s1_lengths, size_t s1_lengths_size,
576576
Range<InputIt> s2,
577577
double score_cutoff) noexcept

0 commit comments

Comments
 (0)