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

canonical form for headers: fast path for 0 headers #344

Merged
merged 1 commit into from
Apr 23, 2018

Conversation

weissi
Copy link
Member

@weissi weissi commented Apr 22, 2018

Motivation:

It's quite common that someone asks for the canonical form of a header
and we don't have any header values. There's no need to do string
comparisons then, we can just return an empty array.

Modifications:

Check if we're asking for a header that isn't present and if so, just
return the empty array.

Result:

Should be ever so slightly faster.

Motivation:

It's quite common that someone asks for the canonical form of a header
and we don't have any header values. There's no need to do string
comparisons then, we can just return an empty array.

Modifications:

Check if we're asking for a header that isn't present and if so, just
return the empty array.

Result:

Should be ever so slightly faster.
Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Yup, seems reasonable to me!

@Lukasa Lukasa added the semver/patch No public API change. label Apr 22, 2018
@normanmaurer normanmaurer merged commit 7fe7ed6 into apple:master Apr 23, 2018
@Lukasa Lukasa modified the milestones: 1.5.1, 1.6.0 Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants