From d45e3b382f87f036207490747dfa6218dd88f33c Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Wed, 17 Feb 2010 00:04:59 +0100 Subject: [PATCH] uninline CaseInsensitiveStringComparison::operator() --- src/helpers.cpp | 17 +++++++++++++++++ src/helpers.h | 17 +---------------- 2 files changed, 18 insertions(+), 16 deletions(-) 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