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
|
bool
|
||||||
BListView::RemoveItems(int32 index, int32 count)
|
BListView::RemoveItems(int32 index, int32 count)
|
||||||
{
|
{
|
||||||
if (index >= CountItems())
|
if (index >= fList.CountItems())
|
||||||
index = -1;
|
index = -1;
|
||||||
|
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// TODO: very bad for performance!!
|
fList.RemoveItems(index, count);
|
||||||
while (count--)
|
if (index < fList.CountItems())
|
||||||
BListView::RemoveItem(index);
|
_RecalcItemTops(index);
|
||||||
|
Invalidate();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user