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 Habersack <grendel@twistedcode.net>2009-07-24 01:12:07 +0400
committerMarek Habersack <grendel@twistedcode.net>2009-07-24 01:12:07 +0400
commit7337b45f49fadaff8f310b5d432240128b82786d (patch)
treeb588bab14ddde95610b326a9b50be7400edb90d8
parentb19ed6cb2f475e72972d7a10c39b4202a37141f1 (diff)
Backport of r137914mono-2-4-2-3-rc2
svn path=/branches/mono-2-4-2/mcs/; revision=138592
-rw-r--r--mcs/class/System/System.Collections.Generic/ChangeLog5
-rw-r--r--mcs/class/System/System.Collections.Generic/SortedList.cs4
2 files changed, 7 insertions, 2 deletions
diff --git a/mcs/class/System/System.Collections.Generic/ChangeLog b/mcs/class/System/System.Collections.Generic/ChangeLog
index 37877e0bf83..466ff8ea6f1 100644
--- a/mcs/class/System/System.Collections.Generic/ChangeLog
+++ b/mcs/class/System/System.Collections.Generic/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-14 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+ * SortedList.cs: the IComparar.Compare arguments were reversed.
+ Fixes bug #521750. Patch by Kevin Fitzgerald.
+
2009-05-06 Pia Eriksson <pe@hallerud.se>
* SortedList.cs: Handle Count == 0 in CopyTo correcly
diff --git a/mcs/class/System/System.Collections.Generic/SortedList.cs b/mcs/class/System/System.Collections.Generic/SortedList.cs
index 96a42743124..a7f9e0deeca 100644
--- a/mcs/class/System/System.Collections.Generic/SortedList.cs
+++ b/mcs/class/System/System.Collections.Generic/SortedList.cs
@@ -643,10 +643,10 @@ namespace System.Collections.Generic
while (left <= right) {
int guess = (left + right) >> 1;
- int cmp = comparer.Compare (key, table[guess].Key);
+ int cmp = comparer.Compare (table[guess].Key, key);
if (cmp == 0) return guess;
- if (cmp > 0) left = guess+1;
+ if (cmp < 0) left = guess+1;
else right = guess-1;
}