summaryrefslogtreecommitdiffstats
path: root/tools/linguist/lupdate
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-08-18 19:23:09 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-09-23 15:44:26 +0200
commit2bc1550b3dfe05353c2cb72f9d980c67e68aceaf (patch)
tree5cb2e4d83215a702bf8782ac52473d409b7a9309 /tools/linguist/lupdate
parent5bd5154ae0095a3e166e8be9347c613b2194e0be (diff)
avoid isalpha() & isalnum()
they are surprisingly expensive
Diffstat (limited to 'tools/linguist/lupdate')
-rw-r--r--tools/linguist/lupdate/cpp.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index e72f1c9256..c224e2f66a 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -561,12 +561,13 @@ uint CppParser::getToken()
}
} while (yyCh != '\n' && yyCh != EOF);
yyCh = getChar();
- } else if (isalpha(yyCh) || yyCh == '_') {
+ } else if ((yyCh >= 'A' && yyCh <= 'Z') || (yyCh >= 'a' && yyCh <= 'z') || yyCh == '_') {
ushort *ptr = (ushort *)yyWord.unicode();
do {
*ptr++ = yyCh;
yyCh = getChar();
- } while (isalnum(yyCh) || yyCh == '_');
+ } while ((yyCh >= 'A' && yyCh <= 'Z') || (yyCh >= 'a' && yyCh <= 'z')
+ || (yyCh >= '0' && yyCh <= '9') || yyCh == '_');
yyWord.resize(ptr - (ushort *)yyWord.unicode());
//qDebug() << "IDENT: " << yyWord;