From 00a9766408c4cc11db6cbea759a0907a00182ceb Mon Sep 17 00:00:00 2001
From: Kai Koehne <kai.koehne@nokia.com>
Date: Mon, 8 Nov 2010 09:41:40 +0100
Subject: [PATCH] DebugHelpers: Use static QRegExp for performance reasons

Reviewed-by: Bill King
---
 src/libs/utils/buildablehelperlibrary.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/libs/utils/buildablehelperlibrary.cpp b/src/libs/utils/buildablehelperlibrary.cpp
index 3fa6ca97cfb..7b42a8d7792 100644
--- a/src/libs/utils/buildablehelperlibrary.cpp
+++ b/src/libs/utils/buildablehelperlibrary.cpp
@@ -90,10 +90,12 @@ QString BuildableHelperLibrary::qtVersionForQMake(const QString &qmakePath)
         return QString();
     }
     const QString output = QString::fromLocal8Bit(qmake.readAllStandardOutput());
-    QRegExp regexp(QLatin1String("(QMake version|QMake version:)[\\s]*([\\d.]*)"), Qt::CaseInsensitive);
+    static QRegExp regexp(QLatin1String("(QMake version|QMake version:)[\\s]*([\\d.]*)"),
+                          Qt::CaseInsensitive);
     regexp.indexIn(output);
     if (regexp.cap(2).startsWith(QLatin1String("2."))) {
-        QRegExp regexp2(QLatin1String("Using Qt version[\\s]*([\\d\\.]*)"), Qt::CaseInsensitive);
+        static QRegExp regexp2(QLatin1String("Using Qt version[\\s]*([\\d\\.]*)"),
+                               Qt::CaseInsensitive);
         regexp2.indexIn(output);
         const QString version = regexp2.cap(1);
         return version;
@@ -108,7 +110,7 @@ bool BuildableHelperLibrary::checkMinimumQtVersion(const QString &qtVersionStrin
     int patch = -1;
 
     // check format
-    QRegExp qtVersionRegex(QLatin1String("^\\d+\\.\\d+\\.\\d+$"));
+    static QRegExp qtVersionRegex(QLatin1String("^\\d+\\.\\d+\\.\\d+$"));
     if (!qtVersionRegex.exactMatch(qtVersionString))
         return false;
 
-- 
GitLab