dotnet / dotnet/linker

Remove HashSets over KeyValuePair

Open
#2,927 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
392
Forks
128
Avg merge
2d 10h
Merged PRs (30d)
2

Description

From https://github.com/dotnet/runtime/issues/73048:

```
System.Private.CoreLib.dll!System.RuntimeType.GetFieldCandidates(string name, System.Reflection.BindingFlags bindingAttr, bool allowPrefixLookup) Unknown
System.Private.CoreLib.dll!System.RuntimeType.GetFields(System.Reflection.BindingFlags bindingAttr) Unknown
System.Private.CoreLib.dll!System.ValueType.Equals(object obj) Unknown
System.Private.CoreLib.dll!System.Collections.Generic.HashSet>.Remove(System.Collections.Generic.KeyValuePair item) Unknown
```

KeyValuePair doesn't implement GetHashCode/Equals, so we use reflection at runtime.

(I would stay away from records too because by properly ordering the checks one can get a better Equals than what Roslyn comes up with.)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.