Minor optimization.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24165 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent 2008-02-28 05:42:07 +00:00
parent 396b8a0dc2
commit 4f8e472b15

View File

@ -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;
}