[haiku-commits] r37488 - haiku/trunk/src/kits/tracker

Author: jackburton
Date: 2010-07-13 10:21:19 +0200 (Tue, 13 Jul 2010)
New Revision: 37488
Changeset: http://dev.haiku-os.org/changeset/37488

Modified:
   haiku/trunk/src/kits/tracker/SlowContextPopup.cpp
Log:
Use BMenu::RemoveItems() instead of iterating.


Modified: haiku/trunk/src/kits/tracker/SlowContextPopup.cpp
===================================================================
--- haiku/trunk/src/kits/tracker/SlowContextPopup.cpp   2010-07-13 02:04:08 UTC 
(rev 37487)
+++ haiku/trunk/src/kits/tracker/SlowContextPopup.cpp   2010-07-13 08:21:19 UTC 
(rev 37488)
@@ -152,9 +152,7 @@
 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 @@
        // 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;
        }


Other related posts:

  • » [haiku-commits] r37488 - haiku/trunk/src/kits/tracker - stefano . ceccherini