forked from qt-creator/qt-creator
CppEditor: Reuse document for search results
Instead of open a document for every entry we do open it only once per search. For that we sort the entries by file path, so that they are clustered together and reuse the last document if the path hasn't changed. This can improve the calculations of the search results drastically. Change-Id: I9c9c1e387624297d84c6a2ca6edb6130f739d295 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -51,6 +51,12 @@ public:
|
||||
&& first.path == second.path;
|
||||
}
|
||||
|
||||
friend bool operator<(const Usage &first, const Usage &second)
|
||||
{
|
||||
return std::tie(first.path, first.line, first.column)
|
||||
< std::tie(second.path, second.line, second.column);
|
||||
}
|
||||
|
||||
public:
|
||||
QString path;
|
||||
int line = 0;
|
||||
|
||||
Reference in New Issue
Block a user