Skip to content
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

Reduce size of HttpHeaderValueCollection #63057

Merged
merged 8 commits into from Dec 23, 2021

Conversation

geoffkizer
Copy link
Contributor

Remove the _validator field by replacing with a check for GenericHeaderParser.TokenListParser, since this is the only thing validators were used for.

Remove the _specialValue field by pushing handling of special values to callers.

Fixes #63054
Fixes #63050

@ghost
Copy link

ghost commented Dec 21, 2021

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Remove the _validator field by replacing with a check for GenericHeaderParser.TokenListParser, since this is the only thing validators were used for.

Remove the _specialValue field by pushing handling of special values to callers.

Fixes #63054
Fixes #63050

Author: geoffkizer
Assignees: -
Labels:

area-System.Net.Http

Milestone: -

@geoffkizer geoffkizer merged commit d2ebffc into dotnet:main Dec 23, 2021
@geoffkizer geoffkizer deleted the cleanuphttpheadervaluecollection branch December 23, 2021 19:49
@@ -22,8 +22,7 @@ public ICollection<string> Allow
{
if (_allow == null)
{
_allow = new HttpHeaderValueCollection<string>(KnownHeaders.Allow.Descriptor,
this, HeaderUtilities.TokenValidator);
_allow = new HttpHeaderValueCollection<string>(KnownHeaders.Allow.Descriptor, this);
}
return _allow;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future cleanup, this can be simplified to just:

public ICollection<string> Allow => _allow ??= new HttpHeaderValueCollection<string>(KnownHeaders.Allow.Descriptor, this);

Same for some other props below.

@karelz karelz added this to the 7.0.0 milestone Jan 11, 2022
@dotnet dotnet locked as resolved and limited conversation to collaborators Feb 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove HttpHeaderValueCollection<T>._specialValue field Remove HttpHeaderValueCollection<T>._validator field
4 participants