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

Consider returning [Substring] from HPACKHeaders.subscript(canonicalForm:) #253

Open
glbrntt opened this issue Oct 30, 2020 · 0 comments
Open
Labels
kind/enhancement Improvements to existing feature.

Comments

@glbrntt
Copy link
Contributor

glbrntt commented Oct 30, 2020

Both HTTPHeaders and HPACKHeaders have very similar APIs. One slight difference is that HTTPHeaders subscript(canonicalForm:) returns [Substring] while HPACKHeaders returns [String].

Returning [Substring] would allow us to potentially avoid some heap allocations as well as bringing the API more in line with HTTPHeaders.

We should consider adding an alternative subscript API now or at least changing this in the next major version of NIO HTTP/2.

@glbrntt glbrntt added the kind/enhancement Improvements to existing feature. label Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements to existing feature.
Projects
None yet
Development

No branches or pull requests

1 participant