forked from qt-creator/qt-creator
FileSearchResult: Use FilePath for fileName
This saves about 2 seconds out of 5 seconds spent in displayResult() for converting from QString into FilePath in main thread (use case: gitgrep with 2 million hits). Change-Id: I6334e8559986501c34c90a5c7c6b4acc9a6953e0 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -190,7 +190,7 @@ void FileSearch::operator()(QFutureInterface<FileSearchResultList> &futureInterf
|
||||
}
|
||||
if (equal) {
|
||||
const QString resultItemText = clippedText(chunk, MAX_LINE_SIZE);
|
||||
results << FileSearchResult(item.filePath,
|
||||
results << FileSearchResult(FilePath::fromString(item.filePath),
|
||||
lineNr,
|
||||
resultItemText,
|
||||
regionPtr - chunkPtr,
|
||||
@@ -268,7 +268,7 @@ void FileSearchRegExp::operator()(QFutureInterface<FileSearchResultList> &future
|
||||
int pos = 0;
|
||||
while ((match = doGuardedMatch(line, pos)).hasMatch()) {
|
||||
pos = match.capturedStart();
|
||||
results << FileSearchResult(item.filePath, lineNr, resultItemText,
|
||||
results << FileSearchResult(FilePath::fromString(item.filePath), lineNr, resultItemText,
|
||||
pos, match.capturedLength(),
|
||||
match.capturedTexts());
|
||||
if (match.capturedLength() == 0)
|
||||
|
||||
Reference in New Issue
Block a user