clear prospectiveContext after "consuming" it
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>
Fri, 26 Jul 2013 17:37:41 +0000 (19:37 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 1 Aug 2013 11:37:30 +0000 (13:37 +0200)
otherwise it would trigger useless assignments later on.

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

index 202111e..7cd3db0 100644 (file)
@@ -2146,14 +2146,18 @@ void CppParser::parseInternal(ConversionData &cd, const QStringList &includeStac
             // fallthrough
         case Tok_Equals:
             if (!prospectiveContext.isEmpty()
-                && yyBraceDepth == namespaceDepths.count() && yyParenDepth == 0)
+                && yyBraceDepth == namespaceDepths.count() && yyParenDepth == 0) {
                 pendingContext = prospectiveContext;
+                prospectiveContext.clear();
+            }
             yyTok = getToken();
             break;
         case Tok_LeftBrace:
             if (!prospectiveContext.isEmpty()
-                && yyBraceDepth == namespaceDepths.count() + 1 && yyParenDepth == 0)
+                && yyBraceDepth == namespaceDepths.count() + 1 && yyParenDepth == 0) {
                 pendingContext = prospectiveContext;
+                prospectiveContext.clear();
+            }
             // fallthrough
         case Tok_LeftParen:
         case Tok_RightParen: