Permalink
Browse files

Backport of r137914

svn path=/branches/mono-2-4-2/mcs/; revision=138592
  • Loading branch information...
1 parent b19ed6c commit 7337b45f49fadaff8f310b5d432240128b82786d @grendello grendello committed Jul 23, 2009
@@ -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
@@ -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;
}

0 comments on commit 7337b45

Please sign in to comment.