From 4f8e472b15091d6c6c84ad48fb187d2d5b82ddf0 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Thu, 28 Feb 2008 05:42:07 +0000 Subject: [PATCH] Minor optimization. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24165 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/ListView.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/kits/interface/ListView.cpp b/src/kits/interface/ListView.cpp index c597227f72..f1a85e3107 100644 --- a/src/kits/interface/ListView.cpp +++ b/src/kits/interface/ListView.cpp @@ -608,16 +608,16 @@ BListView::RemoveItem(BListItem *item) bool BListView::RemoveItems(int32 index, int32 count) { - if (index >= CountItems()) + if (index >= fList.CountItems()) index = -1; if (index < 0) return false; - // TODO: very bad for performance!! - while (count--) - BListView::RemoveItem(index); - + fList.RemoveItems(index, count); + if (index < fList.CountItems()) + _RecalcItemTops(index); + Invalidate(); return true; }