SilverSearcher: Limit the number of calls to nextLine()

It's a preparation step for the incremental parsing.

Change-Id: I98268abd6d3e0210f218663a6c2bb701c3bfc070
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Jarek Kobus
2023-05-31 23:44:43 +02:00
parent a17fe325c0
commit 1e09ac087a

View File

@@ -112,8 +112,10 @@ SearchResultItems parse(const QString &output, const std::optional<QRegularExpre
const FilePath filePath = FilePath::fromPathPart(filePathLine.mid(1));
QStringView hitLine = nextLine(&remainingOutput);
while (!hitLine.isEmpty()) {
while (true) {
QStringView hitLine = nextLine(&remainingOutput);
if (hitLine.isEmpty())
break;
int lineNumber = -1;
if (!parseLineNumber(&hitLine, &lineNumber))
break;
@@ -133,7 +135,6 @@ SearchResultItems parse(const QString &output, const std::optional<QRegularExpre
: QVariant());
items.append(item);
}
hitLine = nextLine(&remainingOutput);
}
}
return items;