Revision fba053e...

Go back to digest for 26th May 2013

Optimization in KDE Base

Frank Reininghaus committed changes in [kde-baseapps] dolphin/src/kitemviews/kfileitemmodel.cpp:

KFileItemModel::insertItems(): guarantee O(N) run time complexity

This commit prevents repeated insertions of single items into the list
m_itemData, which shift all following items by one position and result
in O(N^2) worst case complexity for the entire function.

Moreover, the hash m_items is updated only for the items starting from
the first inserted/removed item to save some superfluous calculations
of hash values.

REVIEW: 110355

File Changes

Modified 1 files
  • dolphin/src/kitemviews/kfileitemmodel.cpp
1 files changed in total