dotnet / dotnet/dotnet-api-docs

Add warning, that keys and items parameters must not refer to the same array.

Open
#3,163 2 comments 1 reaction 0 assignees View on GitHub
area-System.Runtime doc-enhancement dotnet-api/prod Pri2
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

@NineBerry commented on [Tue Sep 10 2019](https://github.com/dotnet/dotnet-api-docs.de-de/issues/40)

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)](https://docs.microsoft.com/de-de/dotnet/api/system.array.sort?view=netframework-4.8#feedback)
* Content Source: [xml/System/Array.xml](https://github.com/dotnet/dotnet-api-docs.de-de/blob/live/xml/System/Array.xml)
* Product: **dotnet-api**
* Technology: **system**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**

---

@srvbpigh commented on [Tue Sep 10 2019](https://github.com/dotnet/dotnet-api-docs.de-de/issues/40#issuecomment-530050584)

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.