From 765aa56d6e92ee3d35f6bd9f650f6ecc05de0ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com> Date: Tue, 26 May 2009 14:02:04 +0200 Subject: [PATCH] Preprocessing an empty expression is always empty Fixes performance issue with typing opening parentheses. Reviewed-by: Roberto Raggi --- src/libs/cplusplus/TypeOfExpression.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/cplusplus/TypeOfExpression.cpp b/src/libs/cplusplus/TypeOfExpression.cpp index 8be7be2572d..bb773b20002 100644 --- a/src/libs/cplusplus/TypeOfExpression.cpp +++ b/src/libs/cplusplus/TypeOfExpression.cpp @@ -133,6 +133,9 @@ QString TypeOfExpression::preprocessedExpression(const QString &expression, Snapshot documents, Document::Ptr thisDocument) const { + if (expression.trimmed().isEmpty()) + return expression; + Environment env; QSet<QString> processed; processEnvironment(documents, thisDocument, -- GitLab