Commit 79ca7e0d authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

use vector, list does heap allocation as elements to large

parent 5a181e3d
......@@ -164,7 +164,7 @@ void KateProjectWorker::loadFilesEntry(QStandardItem *parent, const QVariantMap
*/
QHash<QString, QStandardItem *> dir2Item;
dir2Item[QString()] = parent;
QList<QPair<QStandardItem *, QStandardItem *>> item2ParentPath;
QVector<QPair<QStandardItem *, QStandardItem *>> item2ParentPath;
for (const QString &filePath : files) {
/**
* cheap file name computation
......@@ -196,10 +196,8 @@ void KateProjectWorker::loadFilesEntry(QStandardItem *parent, const QVariantMap
/**
* plug in the file items to the tree
*/
auto i = item2ParentPath.constBegin();
while (i != item2ParentPath.constEnd()) {
i->second->appendRow(i->first);
++i;
for (const auto &item : qAsConst(item2ParentPath)) {
item.second->appendRow(item.first);
}
}
......
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