Description
@NineBerry commented on Tue Sep 10 2019
When passing the same array as both keys and items parameter, in some situations you will get an ArgumentException stating that the "IComparer.Compare() method returns inconsistent results" and in some situations the sort order will just be wrong without getting any exception.
Add a remark in the documentation that this is not allowed.
Additionally, the framework code could actually be changed to check that both arguments don't refer to the same array object.
Dokumentdetails
⚠ Bearbeiten Sie diesen Abschnitt nicht. Er ist für die Verknüpfung von docs.microsoft.com zum GitHub-Artikel erforderlich.
- ID: 9bbc52fb-14ee-c54a-f8fa-66765472d723
- Version Independent ID: 2e15fc32-02f3-977a-44dd-52b0e04185b2
- Content: Array.Sort Method (System)
- Content Source: xml/System/Array.xml
- Product: dotnet-api
- Technology: system
- GitHub Login: @dotnet-bot
- Microsoft Alias: dotnetcontent
@srvbpigh commented on Tue Sep 10 2019
Hello, @NineBerry
Thank you for your feedback.
We are actively reviewing your comments and will get back to you soon.
Kind regards,
Microsoft DOCS International Team