Optimise GetCustomAttributes - Part 1 (#53152)
authorJan Kotas <jkotas@microsoft.com>
Mon, 24 May 2021 04:36:09 +0000 (21:36 -0700)
committerGitHub <noreply@github.com>
Mon, 24 May 2021 04:36:09 +0000 (21:36 -0700)
commit2e9cdea8b7187b35cf56c3b3b4a36cdea12295c9
tree5d0884e1dc730024ff6d455f692436d3c3c0e97f
parent34e6bb44b462511e7574b2935af4e441c34eb608
Optimise GetCustomAttributes - Part 1 (#53152)

- Use is/is not instead of ==/!=. Avoids overhead from operator overloading
- Pass ListBuilder as ref instead of out. Avoids redundant initialization to default.
- Use HashSet instead of Dictionary.

Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
src/coreclr/System.Private.CoreLib/src/System/Reflection/CustomAttribute.cs