Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Backport of r137914

svn path=/branches/mono-2-4-2/mcs/; revision=138592
  • Loading branch information...
commit 7337b45f49fadaff8f310b5d432240128b82786d 1 parent b19ed6c
@grendello grendello authored
View
5 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
View
4 mcs/class/System/System.Collections.Generic/SortedList.cs
@@ -643,10 +643,10 @@ private int Find (TKey key)
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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.