forked from qt-creator/qt-creator
AutoTest: Improve QRegularExpression usages
Use static const if possible to avoid re-initializations. Change-Id: Ibee9e320dccb90cd928737b809db3b56369961ec Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -146,7 +146,7 @@ QString QuickTestParser::quickTestName(const CPlusPlus::Document::Ptr &doc) cons
|
||||
}
|
||||
|
||||
if (pchIncludes) {
|
||||
const QRegularExpression regex("\\bQUICK_TEST_(MAIN|OPENGL_MAIN|MAIN_WITH_SETUP)");
|
||||
static const QRegularExpression regex("\\bQUICK_TEST_(MAIN|OPENGL_MAIN|MAIN_WITH_SETUP)");
|
||||
const QRegularExpressionMatch match = regex.match(QString::fromUtf8(fileContent));
|
||||
if (match.hasMatch())
|
||||
return match.captured(); // we do not care for the name, just return something non-empty
|
||||
|
||||
Reference in New Issue
Block a user