diff --git a/src/helpers.cpp b/src/helpers.cpp index f2d8c6af..28534007 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -226,6 +226,23 @@ void ParseArgv(int argc, char **argv) exit(0); } +int CaseInsensitiveStringComparison::operator()(const std::string &a, const std::string &b) +{ + const char *i = a.c_str(); + const char *j = b.c_str(); + if (Config.ignore_leading_the) + { + if (hasTheWord(a)) + i += 4; + if (hasTheWord(b)) + j += 4; + } + int dist; + while (!(dist = tolower(*i)-tolower(*j)) && *j) + ++i, ++j; + return dist; +} + bool CaseInsensitiveSorting::operator()(const MPD::Item &a, const MPD::Item &b) { if (a.type == b.type) diff --git a/src/helpers.h b/src/helpers.h index 353b0811..81615bf4 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -42,22 +42,7 @@ class CaseInsensitiveStringComparison } public: - int operator()(const std::string &a, const std::string &b) - { - const char *i = a.c_str(); - const char *j = b.c_str(); - if (Config.ignore_leading_the) - { - if (hasTheWord(a)) - i += 4; - if (hasTheWord(b)) - j += 4; - } - int dist; - while (!(dist = tolower(*i)-tolower(*j)) && *j) - ++i, ++j; - return dist; - } + int operator()(const std::string &a, const std::string &b); }; class CaseInsensitiveSorting