summaryrefslogtreecommitdiffstats
path: root/tools/linguist/lupdate
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-08-18 18:09:47 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-09-23 13:44:27 (GMT)
commite4e45bc5bb3a4b38f8f726b26f863c1fdb5575f1 (patch)
treeeaad615708f91b068914e887aa2bee22f12a6ce9 /tools/linguist/lupdate
parentd5d169a79fe199ad210d5625b20344bdc2814e60 (diff)
downloadQt-e4e45bc5bb3a4b38f8f726b26f863c1fdb5575f1.zip
Qt-e4e45bc5bb3a4b38f8f726b26f863c1fdb5575f1.tar.gz
Qt-e4e45bc5bb3a4b38f8f726b26f863c1fdb5575f1.tar.bz2
take advantage of knowing that qstrings are zero-terminated internally
Diffstat (limited to 'tools/linguist/lupdate')
-rw-r--r--tools/linguist/lupdate/cpp.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index 8de403e..3999b84 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -307,13 +307,12 @@ void CppParser::setInput(QTextStream &ts, const QString &fileName)
uint CppParser::getChar()
{
- int len = yyInStr.size();
const ushort *uc = (const ushort *)yyInStr.unicode();
forever {
- if (yyInPos >= len)
- return EOF;
uint c = uc[yyInPos++];
- if (c == '\\' && yyInPos < len) {
+ if (!c)
+ return EOF;
+ if (c == '\\') {
if (uc[yyInPos] == '\n') {
++yyCurLineNo;
++yyInPos;
@@ -322,13 +321,13 @@ uint CppParser::getChar()
if (uc[yyInPos] == '\r') {
++yyCurLineNo;
++yyInPos;
- if (yyInPos < len && uc[yyInPos] == '\n')
+ if (uc[yyInPos] == '\n')
++yyInPos;
continue;
}
}
if (c == '\r') {
- if (yyInPos < len && uc[yyInPos] == '\n')
+ if (uc[yyInPos] == '\n')
++yyInPos;
c = '\n';
++yyCurLineNo;