From 4db1f9f387c42ebfd07ac9ce91202f5d3c617ad2 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Tue, 13 Jul 2010 08:21:19 +0000 Subject: [PATCH] Use BMenu::RemoveItems() instead of iterating. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37488 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/SlowContextPopup.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/kits/tracker/SlowContextPopup.cpp b/src/kits/tracker/SlowContextPopup.cpp index 7b739e7154..10d17252d2 100644 --- a/src/kits/tracker/SlowContextPopup.cpp +++ b/src/kits/tracker/SlowContextPopup.cpp @@ -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; }