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:
authorMarek Safar <marek.safar@gmail.com>2017-03-22 17:05:53 +0300
committerMarek Safar <marek.safar@gmail.com>2017-03-28 00:36:35 +0300
commit778388f9eea26c0398810aa7cd9539651f94101a (patch)
tree31f00a73deffa29c1e38ceb44b8b4d349e85f7ba /mcs/class/System.Windows.Forms
parent62385ee39018965a9e9938adbef4927668fdfd52 (diff)
[System.Windows.Forms] Fixes DataGridViewColumnCollection comparer not to return 1 on match
Diffstat (limited to 'mcs/class/System.Windows.Forms')
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewColumnCollection.cs7
1 files changed, 1 insertions, 6 deletions
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewColumnCollection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewColumnCollection.cs
index 74a7b279686..4a092d34568 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewColumnCollection.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewColumnCollection.cs
@@ -272,12 +272,7 @@ namespace System.Windows.Forms
{
public int Compare (DataGridViewColumn o1, DataGridViewColumn o2)
{
- if (o1.DisplayIndex == o2.DisplayIndex)
- // Here we avoid the equal value swapping that both Array.Sort and ArrayList.Sort
- // do occasionally and preserve the user column insertation order.
- return 1;
- else
- return o1.DisplayIndex - o2.DisplayIndex;
+ return o1.DisplayIndex.CompareTo (o2.DisplayIndex);
}
}
}