forked from qt-creator/qt-creator
Use QString::splitRef() instead of QString::split()
Avoid string allocation where it seems feasible. Change-Id: I61b23d4ef8a459f5aa77727a75f4e1d2b140da3b Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -411,7 +411,7 @@ void CMakeTool::fetchVersionFromVersionOutput() const
|
||||
return;
|
||||
|
||||
QRegularExpression versionLine("^cmake version ((\\d+).(\\d+).(\\d+).*)$");
|
||||
for (const QString &line : response.stdOut().split('\n')) {
|
||||
for (const QStringRef &line : response.stdOut().splitRef(QLatin1Char('\n'))) {
|
||||
QRegularExpressionMatch match = versionLine.match(line);
|
||||
if (!match.hasMatch())
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user