don't reset yyWord right away
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>
Wed, 4 Dec 2013 21:04:08 +0000 (22:04 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 7 Jan 2014 18:49:05 +0000 (19:49 +0100)
there is no point in doing that - all tokens that actually "fill" the
word, calculate the size "from scratch" anyway.
not resetting it potentially allows us to use the word after reading
further tokens. though comments between the tokens would mess things up
...

Change-Id: I27f16444a0a94e3abb37dcf15f2cc788ebe63c7c
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
src/linguist/lupdate/cpp.cpp

index 66659a2..aa32cda 100644 (file)
@@ -471,7 +471,6 @@ bool CppParser::getMacroArgs()
 {
     // Failing this assertion would mean losing the preallocated buffer.
     Q_ASSERT(yyWord.isDetached());
-    yyWord.resize(0);
 
     while (isspace(yyCh))
         yyCh = getChar();
@@ -514,7 +513,6 @@ CppParser::TokenType CppParser::getToken()
   restart:
     // Failing this assertion would mean losing the preallocated buffer.
     Q_ASSERT(yyWord.isDetached());
-    yyWord.resize(0);
 
     while (yyCh != EOF) {
         yyLineNo = yyCurLineNo;