diff options
-rw-r--r-- | mcs/class/System/System.Collections.Generic/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System/System.Collections.Generic/SortedList.cs | 4 |
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; } |