Commit 0645f417 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

use map not filter for concurrency

on a machine with 32 threads, map is 6 times
faster, due to no locking, compared to filter
parent e59b5d72
...@@ -290,10 +290,10 @@ void KateProjectWorker::loadFilesEntry(QStandardItem *parent, const QVariantMap ...@@ -290,10 +290,10 @@ void KateProjectWorker::loadFilesEntry(QStandardItem *parent, const QVariantMap
*/ */
const QString dirPath = dir.path() + QLatin1Char('/'); const QString dirPath = dir.path() + QLatin1Char('/');
QtConcurrent::blockingMap(files, [dirPath](QString &item) { QtConcurrent::blockingMap(files, [dirPath](QString &item) {
if (!QFileInfo(dirPath + item).isFile()) { if (!QFileInfo(dirPath + item).isFile()) {
item.clear(); item.clear();
} }
}); });
/** /**
* construct paths first in tree and items in a map * construct paths first in tree and items in a map
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment