diff --git a/CHANGELOG.md b/CHANGELOG.md index 6459ad3..1cb4aa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Changelog +## [3.0.2] - 2023-03- +### Fixed +- fix assert leading to compilation failures + ## [3.0.1] - 2023-03-03 ### Fixed - fix doxygen warnings diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a63331..2af8555 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt") endif() -project(rapidfuzz LANGUAGES CXX VERSION 3.0.1) +project(rapidfuzz LANGUAGES CXX VERSION 3.0.2) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") include(GNUInstallDirs) diff --git a/extras/rapidfuzz_amalgamated.hpp b/extras/rapidfuzz_amalgamated.hpp index 8a800d9..f7adac6 100644 --- a/extras/rapidfuzz_amalgamated.hpp +++ b/extras/rapidfuzz_amalgamated.hpp @@ -1,7 +1,7 @@ // Licensed under the MIT License . // SPDX-License-Identifier: MIT // RapidFuzz v1.0.2 -// Generated: 2023-12-25 16:10:46.428949 +// Generated: 2024-03-04 00:51:20.496561 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. @@ -6820,7 +6820,7 @@ size_t levenshtein_mbleven2018(const Range& s1, const Range& assert(len1 > 0); assert(len2 > 0); assert(*s1.begin() != *s2.begin()); - assert(*(--s1.end()) != *(--s2.end())); + assert(*(s1.end() - 1) != *(s2.end() - 1)); if (len1 < len2) return levenshtein_mbleven2018(s2, s1, max); @@ -9326,12 +9326,12 @@ namespace rapidfuzz::fuzz { * * @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff */ -template -double ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0); - template double ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); +template +double ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0); + #ifdef RAPIDFUZZ_SIMD namespace experimental { template @@ -9441,13 +9441,13 @@ ScoreAlignment partial_ratio_alignment(const Sentence1& s1, const Senten * * @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff */ +template +double partial_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); + template double partial_ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0); -template -double partial_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); - // todo add real implementation template struct CachedPartialRatio { @@ -9507,13 +9507,13 @@ CachedPartialRatio(InputIt1 first1, InputIt1 last1) -> CachedPartialRatio +double token_sort_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); + template double token_sort_ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0); -template -double token_sort_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); - #ifdef RAPIDFUZZ_SIMD namespace experimental { template @@ -9610,13 +9610,13 @@ CachedTokenSortRatio(InputIt1 first1, InputIt1 last1) -> CachedTokenSortRatio +double partial_token_sort_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); + template double partial_token_sort_ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0); -template -double partial_token_sort_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); - // TODO documentation template struct CachedPartialTokenSortRatio { @@ -9678,13 +9678,13 @@ CachedPartialTokenSortRatio(InputIt1 first1, InputIt1 last1) * * @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff */ +template +double token_set_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); + template double token_set_ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0); -template -double token_set_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); - // TODO documentation template struct CachedTokenSetRatio { @@ -9735,13 +9735,13 @@ CachedTokenSetRatio(InputIt1 first1, InputIt1 last1) -> CachedTokenSetRatio +double partial_token_set_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); + template double partial_token_set_ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0); -template -double partial_token_set_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); - // TODO documentation template struct CachedPartialTokenSetRatio { @@ -9793,12 +9793,12 @@ CachedPartialTokenSetRatio(InputIt1 first1, InputIt1 last1) * * @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff */ -template -double token_ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0); - template double token_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); +template +double token_ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0); + // todo add real implementation template struct CachedTokenRatio { @@ -9855,13 +9855,13 @@ CachedTokenRatio(InputIt1 first1, InputIt1 last1) -> CachedTokenRatio +double partial_token_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); + template double partial_token_ratio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0); -template -double partial_token_ratio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); - // todo add real implementation template struct CachedPartialTokenRatio { @@ -9917,12 +9917,12 @@ CachedPartialTokenRatio(InputIt1 first1, InputIt1 last1) -> CachedPartialTokenRa * * @return returns the ratio between s1 and s2 or 0 when ratio < score_cutoff */ -template -double WRatio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0); - template double WRatio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); +template +double WRatio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0); + // todo add real implementation template struct CachedWRatio { @@ -9977,12 +9977,12 @@ CachedWRatio(InputIt1 first1, InputIt1 last1) -> CachedWRatio -double QRatio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0); - template double QRatio(const Sentence1& s1, const Sentence2& s2, double score_cutoff = 0); +template +double QRatio(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double score_cutoff = 0); + #ifdef RAPIDFUZZ_SIMD namespace experimental { template diff --git a/rapidfuzz/distance/Levenshtein_impl.hpp b/rapidfuzz/distance/Levenshtein_impl.hpp index 5f6f67b..d43e688 100644 --- a/rapidfuzz/distance/Levenshtein_impl.hpp +++ b/rapidfuzz/distance/Levenshtein_impl.hpp @@ -167,7 +167,7 @@ size_t levenshtein_mbleven2018(const Range& s1, const Range& assert(len1 > 0); assert(len2 > 0); assert(*s1.begin() != *s2.begin()); - assert(*(--s1.end()) != *(--s2.end())); + assert(*(s1.end() - 1) != *(s2.end() - 1)); if (len1 < len2) return levenshtein_mbleven2018(s2, s1, max);