Replace typeof(X).Name
with nameof(X)
#1077
Labels
good-first-issue
Good for newcomers
is:task
A chore to be done
pri:low
up-for-grabs
This issue is open to be worked on by anyone
Milestone
Is there an existing issue for this?
Task description
Split from PR #1074. There have been a few cases we've fixed where the code has been getting the name of a type as a string by using the pattern
typeof(SomeType).Name
, when code analysis warnings show that we should be usingnameof(SomeType)
instead. This potentially has a small performance benefit if the compiler/PGO is not already smart enough to recognize this pattern, but at the least it will simplify the code and reduce some analysis warnings.The text was updated successfully, but these errors were encountered: