dotnet / dotnet/dotnet-api-docs

Using a ValueTuple to Create Hash Code

Open
#863 0 comments 0 reactions 0 assignees View on GitHub
area-System.Runtime dotnet-api/prod Pri2 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

Can we use a ValueTuple for creating a hash code. So instead of
```
return Tuple.Create(x, y).GetHashCode();
```
```
return (x,y).GetHashCode();
```

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 4e3cf3f3-9e8f-1c90-968b-a96ef6cb9d34
* Version Independent ID: 5f0e9dde-3253-ad99-c858-f061e61daa3f
* Content: [Object.GetHashCode Method (System)](https://docs.microsoft.com/en-us/dotnet/api/system.object.gethashcode?view=netframework-4.7.2)
* Content Source: [xml/System/Object.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System/Object.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**

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.