diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2009-07-15 05:02:35 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2009-07-15 05:02:35 +0400 |
commit | 05f367e52ddd8ad3c19488dede863a1b65efbb30 (patch) | |
tree | 3466607da3a61d53f028c06cbf5c72844ae91d7d /mcs/class/System | |
parent | 6318401c2aa29348fecd9ed3eae17f0d7bc7cb55 (diff) |
2009-07-14 Gonzalo Paniagua Javier <gonzalo@novell.com>
* SortedList.cs: the IComparar.Compare arguments were reversed.
Fixes bug #521750. Patch by Kevin Fitzgerald.
svn path=/trunk/mcs/; revision=137914
Diffstat (limited to 'mcs/class/System')
-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 1188a0c4c57..e03ed5c92c3 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-10 Andy Hume <andyhume32@yahoo.co.uk> * LinkedList.cs: Add null check. Fixes #481621. diff --git a/mcs/class/System/System.Collections.Generic/SortedList.cs b/mcs/class/System/System.Collections.Generic/SortedList.cs index 9950423d035..969eb5f408f 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; } |