Minor optimization.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24165 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
396b8a0dc2
commit
4f8e472b15
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user