From 1c304f30b97b1759beb7a1e92b1f1c63e37e9315 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 4 Dec 2006 01:46:07 +0000 Subject: [PATCH] use Remove(-1) instead of looping over all images manually in RemoveAll() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43785 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/imaglist.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/msw/imaglist.cpp b/src/msw/imaglist.cpp index daf1d5f72b..ff36d8bbb2 100644 --- a/src/msw/imaglist.cpp +++ b/src/msw/imaglist.cpp @@ -228,15 +228,7 @@ bool wxImageList::Remove(int index) bool wxImageList::RemoveAll() { // don't use ImageList_RemoveAll() because mingw32 headers don't have it - int count = ImageList_GetImageCount(GetHImageList()); - for ( int i = 0; i < count; i++ ) - { - // the image indexes are shifted, so we should always remove the first - // one - (void)Remove(0); - } - - return true; + return Remove(-1); } // Draws the given image on a dc at the specified position. -- 2.45.2