┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests/kfileitemmodelbenchmark.cpp
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2013-01-27 13:07:46 +0100
committerFrank Reininghaus <[email protected]>2013-01-27 13:07:46 +0100
commitd1b75d1d64d803d2b1099fb26f114342092249e3 (patch)
treeedba0127281556246c96e3f9fd4429c9efc9a155 /src/tests/kfileitemmodelbenchmark.cpp
parent71be8f2bee8347460aebabd570b24f6393104423 (diff)
Performance improvements in KFileItemModel::removeItems()
The performance of this method is improved by: a) Not removing items one by one, but doing it in a way that minimizes the number of moves to prevent O(N^2) worst-case complexity. b) Not sorting the removed items using the potentially extremely slow KFileItemModel::lessThan. We can get the indexes of the removed items very easily from the hash m_items, and sorting ints is a lot faster. c) Preventing repeated rehashing of m_items when removing the deleted URLs by replacing remove() by erase(). REVIEW: 108540
Diffstat (limited to 'src/tests/kfileitemmodelbenchmark.cpp')
0 files changed, 0 insertions, 0 deletions