]> cloud.milkyroute.net Git - dolphin.git/commit
Fix O(N^2) complexity issue in KItemListView::slotItemsRemoved()
authorFrank Reininghaus <frank78ac@googlemail.com>
Fri, 5 Jul 2013 17:47:44 +0000 (19:47 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Fri, 5 Jul 2013 17:51:14 +0000 (19:51 +0200)
commit6028bd7cf6fcd65bc43d255f1f0eaf0820ee79b6
treea19f74cb2407158d1f4f6ff1e450d1b964581aa5
parent837be34333bc1b7d85649418366f26d64a6d6b2c
Fix O(N^2) complexity issue in KItemListView::slotItemsRemoved()

If many item ranges are removed, KItemListView::slotItemsRemoved()
could take very long because it looped over all items after the first
removed one for every removed range, even if most of these items are
not visible at all.

This commit improves this by just looping over the visible items (whose
number is limited by the window size) for each range.

Test case (for very large N):

touch {1..N}.png
touch {1..N}.jpg

(wait until all files are shown in the view)

rm *.jpg

REVIEW: 111398
src/kitemviews/kitemlistview.cpp