-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Make H3StaticTable class static #36222
Conversation
Tagging subscribers to this area: @dotnet/ncl |
private H3StaticTable() | ||
{ | ||
} | ||
|
||
public static H3StaticTable Instance { get; } = new H3StaticTable(); | ||
|
||
public int Count => _staticTable.Length; | ||
|
||
public HeaderField this[int index] => _staticTable[index]; |
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.
The indexers aren't allowed in static class. I tried to check if it was used any where but found none. However, I can't confirm because I run into build problems on my machine, so I'll wait for the CI build to finish and check.
This is going to require a matching PR in AspNetCore as well. |
Isn't this done automatically, just like dotnet/aspnetcore#20640? |
That's a fail-safe to make sure we don't miss anything. We want to know changes compile and work in both repos before merging them in either. That said, this one's probably OK since it didn't change any of the API surface area consumed by HttpClient or Kestrel. We can auto-merge it when the tests pass. |
Ok, I'm going to create a similar PR in aspnetcore |
After giving a look, it won't actually compile correctly in aspnetcore 😆 Because indexers can't be used in static class, I'll have to make a method instead of the indexer. Should this method be included here also? (given that it's used only in aspnetnet repo but not here) |
Yes, the shared files should match exactly. There's instructions in the readme for copying the files. You can develop the fix in either repo, but make sure to copy it when you're done. |
Thanks for guidance, I'll fix it soon. |
I opened dotnet/aspnetcore#21705 |
src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecoder.cs
Show resolved
Hide resolved
@@ -28,7 +27,7 @@ internal class H3StaticTable | |||
[500] = 71, | |||
}; | |||
|
|||
private readonly Dictionary<HttpMethod, int> _methodIndex = new Dictionary<HttpMethod, int> | |||
private static readonly Dictionary<HttpMethod, int> _methodIndex = new Dictionary<HttpMethod, int> |
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.
All of these static fields should now be renamed to have an s_ rather than just _ prefix.
@Tratcher @stephentoub The parallel PR (dotnet/aspnetcore#21705) is merged. |
Hello @Tratcher! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
@Tratcher, should I merge this? Not sure how the mirror works. |
@stephentoub yes please. Ideally we merge the changes into both repos on the same day and then the mirror doesn't have to do anything. It's only there as a failsafe. |
No description provided.