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

Add initializer for HTTPFields that reserves space for standard headers #463

Merged
merged 2 commits into from
May 25, 2024

Conversation

adam-fowler
Copy link
Member

No description provided.

@adam-fowler adam-fowler requested a review from Joannis May 25, 2024 08:26
/// - Parameters:
/// - contentType: Content Type header
/// - contentLength: Content Length
init(
Copy link
Contributor

@MahdiBM MahdiBM May 25, 2024

Choose a reason for hiding this comment

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

I'd prefer a static func like static func withExtraCapacity / static func withExtraReservedCapacity for better readabilty/clarity, even though this is only an internal function, unless it makes some kind of non-insignificant difference in the compiled code (I know inits have some special properties, but i've never cared enough for such optimizations to actually go after it)

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair enough wasn't totally happy with the init I must say.

@adam-fowler adam-fowler merged commit cf719a7 into main May 25, 2024
5 checks passed
@adam-fowler adam-fowler deleted the reserve-headers branch May 25, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants