]> git.saurik.com Git - wxWidgets.git/commitdiff
Make a single for loop out of two
authorRobert Roebling <robert@roebling.de>
Tue, 10 Mar 2009 18:31:00 +0000 (18:31 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 10 Mar 2009 18:31:00 +0000 (18:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/dataview.cpp

index ba50a455d425f48e404e9b0ff8af91befb42aa3a..71bb162ad43e511c6dbe3557fe81c08b12bcff53 100644 (file)
@@ -3022,14 +3022,15 @@ void wxGtkTreeModelNode::Resort()
     // Sort array keeping original positions
     wxQsort( temp, child_count, sizeof(wxGtkTreeModelChildWithPos),
              &wxGtkTreeModelChildWithPosCmp, m_internal );
-    // Transfer positions to new_order array
+    // Transfer positions to new_order array and
+    // IDs to m_children
+    m_children.Clear();
     gint *new_order = new gint[child_count];
     for (i = 0; i < child_count; i++)
+    {
        new_order[i] = temp[i].pos;
-    // Transfer IDs to m_children
-    m_children.Clear();
-    for (i = 0; i < child_count; i++)
        m_children.Add( temp[i].id );
+    }
     // Delete array
     delete [] temp;
 #else