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

Lowercase page names before lookup #227

Merged
merged 1 commit into from
Dec 5, 2021
Merged

Lowercase page names before lookup #227

merged 1 commit into from
Dec 5, 2021

Conversation

dbrgn
Copy link
Collaborator

@dbrgn dbrgn commented Dec 4, 2021

This adds another allocation that wasn't necessary before, but the overhead is totally negligible.

Part of #209.

@dbrgn dbrgn added this to the v1.5.0 milestone Dec 4, 2021
@dbrgn dbrgn mentioned this pull request Dec 4, 2021
3 tasks
@niklasmohrin
Copy link
Collaborator

I wonder why they don't have a make_lowercase 🤔 I agree, the one allocation doesn't matter. However, I think it would be nice to have the code that handles these what-users-enter-vs-what-files-we-are-looking-for logic in one place. Maybe this change here is better fit right after the code where the words are joined with '-'? What do you think?

@dbrgn
Copy link
Collaborator Author

dbrgn commented Dec 5, 2021

I wonder why they don't have a make_lowercase 🤔

You mean in-place? That won't work, because it might be possible that the lowercased string requires more bytes than the uppercased string (depending on some unicode edge cases). It's not all ASCII 🙂

Maybe this change here is better fit right after the code where the words are joined with '-'? What do you think?

Yeah, that would actually make sense, then the user sees the real page name that was used for the lookup in the error message (if the page wasn't found).

@dbrgn dbrgn merged commit 023a9d2 into master Dec 5, 2021
@dbrgn dbrgn deleted the lowercase-page-name branch December 5, 2021 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants