Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Westfall <jwestfall@surrealistic.net>2014-11-09 03:37:33 +0300
committerJim Westfall <jwestfall@surrealistic.net>2014-11-09 03:37:33 +0300
commit7d1b878fbf13462a282860c6d1dd493a48d7b1eb (patch)
treef9935606c592367761ef6d749bc9286adbe7d423 /mcs/class/Managed.Windows.Forms/System.Windows.Forms
parent690a646c5e48f78313d16587a02a2380bf9e6c4d (diff)
[MWF] DataGridViewRowCollection Clear() speed up
When issuing a Clear() to remove all rows, a ReIndex() was being called for each row that was being removed. This is extremely inefficient, instead do a single ReIndex() after all rows have been removed. Before doing a Clear() of 30k rows was taking 5.8 seconds. With this patch it now takes 670ms.
Diffstat (limited to 'mcs/class/Managed.Windows.Forms/System.Windows.Forms')
-rw-r--r--mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs
index 8261f1f8756..9badc1dc7ab 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs
@@ -268,9 +268,9 @@ namespace System.Windows.Forms
row.SetDataGridView (null);
list.Remove (row);
- ReIndex ();
}
+ ReIndex ();
DataGridView.OnRowsPostRemovedInternal (new DataGridViewRowsRemovedEventArgs (0, total));
OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Refresh, null));
}