]> git.saurik.com Git - wxWidgets.git/commitdiff
Append all items at once during wxChoice creation in wxMSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 24 Jan 2012 21:50:34 +0000 (21:50 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 24 Jan 2012 21:50:34 +0000 (21:50 +0000)
Appending all items at once is more efficient than doing it one by one in the
loop 9probably because of CB_INITSTORAGE that we send in this case).

Closes #13899.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70454 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/choice.cpp

index 8dc803b88b87452e41c8a2affb0eb08852739aab..ee5f46167e75aceb6cbe391f544562c44c4832eb 100644 (file)
@@ -86,10 +86,7 @@ bool wxChoice::CreateAndInit(wxWindow *parent,
 
 
     // initialize the controls contents
-    for ( int i = 0; i < n; i++ )
-    {
-        Append(choices[i]);
-    }
+    Append(n, choices);
 
     // and now we may finally size the control properly (if needed)
     SetInitialSize(size);