mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
[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.
This commit is contained in:
parent
68704c2a28
commit
7c0b5c08cc
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue