[Mono-bugs] [Bug 582502] New: System.Linq.Enumerable.OrderByDescending is a not stable sort

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Feb 23 20:24:41 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=582502

http://bugzilla.novell.com/show_bug.cgi?id=582502#c0


           Summary: System.Linq.Enumerable.OrderByDescending is a not
                    stable sort
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Sys.Core
        AssignedTo: jbevain at novell.com
        ReportedBy: tom.philpot at logos.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=344295)
 --> (http://bugzilla.novell.com/attachment.cgi?id=344295)
Test case for reported bug

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8

According to MSDN, System.Linq.Enumerable.OrderByDescending should be stable

--- From http://msdn.microsoft.com/en-us/library/bb534855.aspx
This method performs a stable sort; that is, if the keys of two elements are
equal, the order of the elements is preserved. In contrast, an unstable sort
does not preserve the order of elements that have the same key.

In Mono 2.6.x (tested on Windows and Mac OS X), the sort is not stable.

Reproducible: Always

Steps to Reproduce:
1. Compile and run the attached test case.
2.
3.
Actual Results:  
ws1048-snow:Downloads tom.philpot$ /opt/mono/bin/gmcs DevBug13300Test.cs 
ws1048-snow:Downloads tom.philpot$ /opt/mono/bin/mono DevBug13300Test.exe
True - 9
True - 7
True - 5
True - 3
True - 1
False - 10
False - 8
False - 6
False - 4
False - 2


Expected Results:  
True - 1
True - 3
True - 5
True - 7
True - 9
False - 2
False - 4
False - 6
False - 8
False - 10

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list