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:
@@ -112,8 +112,8 @@ TestCases QtTestParser::testCases(const CppEditor::CppModelManager *modelManager
|
||||
return astVisitor.testCases();
|
||||
|
||||
TestCases result;
|
||||
const QRegularExpression regex("\\b(QTEST_(APPLESS_|GUILESS_)?MAIN)"
|
||||
"\\s*\\(\\s*([[:alnum:]]+)\\s*\\)");
|
||||
static const QRegularExpression regex("\\b(QTEST_(APPLESS_|GUILESS_)?MAIN)"
|
||||
"\\s*\\(\\s*([[:alnum:]]+)\\s*\\)");
|
||||
QRegularExpressionMatchIterator it = regex.globalMatch(QString::fromUtf8(document->utf8Source()));
|
||||
while (it.hasNext()) {
|
||||
const QRegularExpressionMatch match = it.next();
|
||||
|
||||
Reference in New Issue
Block a user