Commit 7c0b5c08 authored by Stefan Brüns's avatar Stefan Brüns
Browse files

[FileItemRolesUpdater] Reserve space in two temporary lists

Reserve sufficient space to avoid reallocation later. Overallocating
actually requires less memory than growing and copying it, and it
is freed immediately after anyway.
parent 68704c2a
......@@ -954,6 +954,8 @@ void KFileItemModelRolesUpdater::updateChangedItems()
QList<int> visibleChangedIndexes;
QList<int> invisibleChangedIndexes;
visibleChangedIndexes.reserve(m_changedItems.size());
invisibleChangedIndexes.reserve(m_changedItems.size());
// Iterate over a const copy because items are deleted within the loop
const auto changedItems = m_changedItems;
......
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