-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the regex from data protection #28114
Conversation
src/DataProtection/DataProtection/src/TypeForwardingActivator.cs
Outdated
Show resolved
Hide resolved
src/DataProtection/DataProtection/src/TypeForwardingActivator.cs
Outdated
Show resolved
Hide resolved
if (versionEndIndex == -1) | ||
{ | ||
// No end index? | ||
return forwardedTypeName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be:
return forwardedTypeName.Substring(0, versionStartIndex);
? Otherwise it could contain a Version=something
but nothing after it?
For reference, I pinged David about this as this regex was being compiled as part of a default MVC app startup and taking ~8% of the time. Related to dotnet/runtime#44598 |
Co-authored-by: Stephen Toub <[email protected]>
The tests are a bit more complex than removing a single version from a type name it seems. The current implementation handles generics (which I'm dubious is even a scenario that happens). |
What is the scenario here? With the default MVC template, I see this code kicking in to forward several types; why should anything new require forwarding? |
Will revisit. @HaoK if you're looking at data protection we should look at this. |
Sure, I can roll this into the span work, linking to #30013 |
cc @stephentoub