[Lldb-commits] [lldb] r106580 - /lldb/trunk/source/Utility/StringExtractor.cpp
Benjamin Kramer
benny.kra at googlemail.com
Tue Jun 22 14:28:05 PDT 2010
Author: d0k
Date: Tue Jun 22 16:28:05 2010
New Revision: 106580
URL: http://llvm.org/viewvc/llvm-project?rev=106580&view=rev
Log:
Avoid tolower, it's slow and unnecessary.
Modified:
lldb/trunk/source/Utility/StringExtractor.cpp
Modified: lldb/trunk/source/Utility/StringExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/StringExtractor.cpp?rev=106580&r1=106579&r2=106580&view=diff
==============================================================================
--- lldb/trunk/source/Utility/StringExtractor.cpp (original)
+++ lldb/trunk/source/Utility/StringExtractor.cpp Tue Jun 22 16:28:05 2010
@@ -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';
}
More information about the lldb-commits
mailing list