Use BMenu::RemoveItems() instead of iterating.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37488 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2010-07-13 08:21:19 +00:00
parent 1c0b18c75c
commit 4db1f9f387
+2 -6
View File
@@ -152,9 +152,7 @@ BSlowContextMenu::NeedsToRebuild() const
void
BSlowContextMenu::ClearMenu()
{
int32 count = CountItems();
for (int32 index = count - 1; index >= 0; index--)
delete RemoveItem(index);
RemoveItems(0, CountItems(), true);
fMenuBuilt = false;
}
@@ -169,9 +167,7 @@ BSlowContextMenu::ClearMenuBuildingState()
// item list is non-owning, need to delete the items because
// they didn't get added to the menu
if (fItemList) {
int32 count = fItemList->CountItems();
for (int32 index = count - 1; index >= 0; index--)
delete RemoveItem(index);
RemoveItems(0, fItemList->CountItems(), true);
delete fItemList;
fItemList = NULL;
}