diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-04-05 10:02:08 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-04-05 10:02:09 +0200 |
commit | bfe5e510b90684d016fb0c68114f85708f7cffda (patch) | |
tree | 0ae25857ca1f50bd04ea1b405afcf863b082b012 /tests/auto/other | |
parent | 6ada4155aff6a106d918ec1b93923bed9617ab27 (diff) | |
parent | 4b4870a12cd920cd45c534deae7ca90716398a19 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I954bd6418bc862a04691240c0f1766f6ce033640
Diffstat (limited to 'tests/auto/other')
-rw-r--r-- | tests/auto/other/lancelot/paintcommands.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp index 4e0cb3b835..074644393d 100644 --- a/tests/auto/other/lancelot/paintcommands.cpp +++ b/tests/auto/other/lancelot/paintcommands.cpp @@ -192,7 +192,7 @@ QList<QPair<QString,QStringList> > PaintCommands::s_enumsTable = QList<QPair<QSt QMultiHash<QString, int> PaintCommands::s_commandHash; #define DECL_PAINTCOMMAND(identifier, method, regexp, syntax, sample) \ - s_commandInfoTable << PaintCommandInfos(QLatin1String(identifier), &PaintCommands::method, QRegularExpression(regexp, QRegularExpression::OptimizeOnFirstUsageOption), \ + s_commandInfoTable << PaintCommandInfos(QLatin1String(identifier), &PaintCommands::method, QRegularExpression(regexp), \ QLatin1String(syntax), QLatin1String(sample) ); #define DECL_PAINTCOMMANDSECTION(title) \ @@ -615,6 +615,8 @@ void PaintCommands::staticInit() // populate the command lookup hash for (int i=0; i<s_commandInfoTable.size(); i++) { + // and pre-optimize the regexps. + s_commandInfoTable.at(i).regExp.optimize(); if (s_commandInfoTable.at(i).isSectionHeader() || s_commandInfoTable.at(i).identifier == QLatin1String("comment") || s_commandInfoTable.at(i).identifier == QLatin1String("noop")) @@ -682,6 +684,7 @@ void PaintCommands::insertAt(int commandIndex, const QStringList &newCommands) **********************************************************************************/ void PaintCommands::runCommand(const QString &scriptLine) { + static QRegularExpression separators("\\s"); if (scriptLine.isEmpty()) { command_noop(QRegularExpressionMatch()); return; @@ -690,7 +693,7 @@ void PaintCommands::runCommand(const QString &scriptLine) command_comment(QRegularExpressionMatch()); return; } - QString firstWord = scriptLine.section(QRegularExpression("\\s"), 0, 0); + QString firstWord = scriptLine.section(separators, 0, 0); QList<int> indices = s_commandHash.values(firstWord); foreach(int idx, indices) { PaintCommandInfos command = s_commandInfoTable.at(idx); |