From bb932f5aad4cdcf2ce2a81ccb96ceb2fd3de6a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Pr=C3=A4ntare?= Date: Wed, 6 Apr 2022 20:25:21 +0200 Subject: [PATCH] Remove unnecessary templatization --- src/libprojectM/Common.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libprojectM/Common.hpp b/src/libprojectM/Common.hpp index 9dcd00c26..6192d9aab 100755 --- a/src/libprojectM/Common.hpp +++ b/src/libprojectM/Common.hpp @@ -117,15 +117,14 @@ inline double meanSquaredError(const double& x, const double& y) return (x - y) * (x - y); } -template -auto CaseInsensitiveSubstringFind(const T& haystack, const T& needle, const std::locale& loc = std::locale()) -> size_t +inline auto CaseInsensitiveSubstringFind(std::string const& haystack, std::string const& needle, const std::locale& loc = std::locale()) -> size_t { auto const it = std::search( haystack.cbegin(), haystack.cend(), needle.cbegin(), needle.cend(), - [&loc](typename T::value_type ch1, typename T::value_type ch2) { + [&loc](char ch1, char ch2) { return std::toupper(ch1, loc) == std::toupper(ch2, loc); });