Avoid tolower, it's slow and unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@106580 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Utility/StringExtractor.cpp b/source/Utility/StringExtractor.cpp
index d2f69f9..86cd623 100644
--- a/source/Utility/StringExtractor.cpp
+++ b/source/Utility/StringExtractor.cpp
@@ -17,18 +17,20 @@
static inline int
xdigit_to_sint (char ch)
{
- ch = tolower(ch);
if (ch >= 'a' && ch <= 'f')
return 10 + ch - 'a';
+ if (ch >= 'A' && ch <= 'F')
+ return 10 + ch - 'A';
return ch - '0';
}
static inline unsigned int
xdigit_to_uint (uint8_t ch)
{
- ch = tolower(ch);
if (ch >= 'a' && ch <= 'f')
return 10u + ch - 'a';
+ if (ch >= 'A' && ch <= 'F')
+ return 10u + ch - 'A';
return ch - '0';
}