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

Simplify CanonicalName #1494

Merged
merged 1 commit into from
Nov 2, 2023
Merged

Conversation

tmthrgd
Copy link
Collaborator

@tmthrgd tmthrgd commented Oct 31, 2023

This function was previously changed from using strings.ToLower to a custom loop to ensure it only lowercases ASCII characters. This was more complicated than it needed to be and introduced more allocations than is necessary.

Instead of that approach we call strings.Map with a simple ASCII lowercase mapping function. Sadly we still use the nice ASCII-only fast path that strings.ToLower had, but it's unlikely to be worth all the extra code.

Updates #1434
Updates #1470

This function was previously changed from using strings.ToLower to a
custom loop to ensure it only lowercases ASCII characters. This was
more complicated than it needed to be and introduced more allocations
than is necessary.

Instead of that approach we call strings.Map with a simple ASCII
lowercase mapping function. Sadly we still use the nice ASCII-only fast
path that strings.ToLower had, but it's unlikely to be worth all the
extra code.
@tmthrgd tmthrgd requested a review from miekg as a code owner October 31, 2023 03:12
@miekg miekg merged commit 8a3ef11 into miekg:master Nov 2, 2023
4 checks passed
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.

2 participants