1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Remove old boost includes and defines

This commit is contained in:
Ivan Savenko
2025-03-18 14:37:22 +00:00
parent 8e1bd64799
commit 7a3e1409d0
18 changed files with 37 additions and 29 deletions

View File

@@ -317,10 +317,11 @@ DLL_LINKAGE bool TextOperations::compareLocalizedStrings(std::string_view str1,
std::optional<int> TextOperations::textSearchSimilarityScore(const std::string & s, const std::string & t)
{
static const std::locale loc = boost::locale::generator().generate(getLocaleName());
static const std::locale loc(getLocaleName());
static const std::collate<char> & col = std::use_facet<std::collate<char>>(loc);
auto haystack = boost::locale::to_lower(t, loc);
auto needle = boost::locale::to_lower(s, loc);
auto haystack = col.transform(t.data(), t.data() + t.size());
auto needle = col.transform(s.data(), s.data() + s.size());
// 0 - Best possible match: text starts with the search string
if(haystack.rfind(needle, 0) == 0)