mirror of
https://github.com/zealdocs/zeal.git
synced 2024-12-02 09:44:14 +03:00
registry: Check for canceled search prior to sorting results
This gives a slightly noticeable performance improvement.
This commit is contained in:
parent
40b8d4ac0a
commit
4b3e1df51d
@ -149,10 +149,16 @@ void DocsetRegistry::_runQuery(const QString &query, const CancellationToken &to
|
||||
query, token),
|
||||
&MergeQueryResults);
|
||||
QList<SearchResult> results = queryResultsFuture.result();
|
||||
|
||||
if (token.isCanceled())
|
||||
return;
|
||||
|
||||
std::sort(results.begin(), results.end());
|
||||
|
||||
if (!token.isCanceled())
|
||||
emit queryCompleted(results);
|
||||
if (token.isCanceled())
|
||||
return;
|
||||
|
||||
emit queryCompleted(results);
|
||||
}
|
||||
|
||||
// Recursively finds and adds all docsets in a given directory.
|
||||
|
Loading…
Reference in New Issue
Block a user