summaryrefslogtreecommitdiffstats
path: root/tools/linguist/lupdate
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-08-18 20:09:47 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-09-23 15:44:27 +0200
commite4e45bc5bb3a4b38f8f726b26f863c1fdb5575f1 (patch)
treeeaad615708f91b068914e887aa2bee22f12a6ce9 /tools/linguist/lupdate
parentd5d169a79fe199ad210d5625b20344bdc2814e60 (diff)
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 8de403e5a5..3999b84a4e 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;