Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
79ca7e0d
Commit
79ca7e0d
authored
Feb 02, 2021
by
Christoph Cullmann
🐮
Browse files
use vector, list does heap allocation as elements to large
parent
5a181e3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/project/kateprojectworker.cpp
View file @
79ca7e0d
...
...
@@ -164,7 +164,7 @@ void KateProjectWorker::loadFilesEntry(QStandardItem *parent, const QVariantMap
*/
QHash
<
QString
,
QStandardItem
*>
dir2Item
;
dir2Item
[
QString
()]
=
parent
;
Q
List
<
QPair
<
QStandardItem
*
,
QStandardItem
*>>
item2ParentPath
;
Q
Vector
<
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
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment