From af7b6a09a885f1bf1b4b13b7114a433633a6c102 Mon Sep 17 00:00:00 2001 From: Grigory Date: Thu, 28 Feb 2019 00:24:43 +0300 Subject: [PATCH] Simplify Misc::StringUtils::toLower --- components/misc/stringops.hpp | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/components/misc/stringops.hpp b/components/misc/stringops.hpp index 58e1651b8e..f0b488f28e 100644 --- a/components/misc/stringops.hpp +++ b/components/misc/stringops.hpp @@ -25,36 +25,7 @@ public: /// Don't use tolower(int) because that depends on global locale. static char toLower(char c) { - switch(c) - { - case 'A':return 'a'; - case 'B':return 'b'; - case 'C':return 'c'; - case 'D':return 'd'; - case 'E':return 'e'; - case 'F':return 'f'; - case 'G':return 'g'; - case 'H':return 'h'; - case 'I':return 'i'; - case 'J':return 'j'; - case 'K':return 'k'; - case 'L':return 'l'; - case 'M':return 'm'; - case 'N':return 'n'; - case 'O':return 'o'; - case 'P':return 'p'; - case 'Q':return 'q'; - case 'R':return 'r'; - case 'S':return 's'; - case 'T':return 't'; - case 'U':return 'u'; - case 'V':return 'v'; - case 'W':return 'w'; - case 'X':return 'x'; - case 'Y':return 'y'; - case 'Z':return 'z'; - default:return c; - }; + return (c >= 'A' && c <= 'Z') ? c + 'a' - 'A' : c; } static Utf8Stream::UnicodeChar toLowerUtf8(Utf8Stream::UnicodeChar ch)