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

URI::GID: Update #check_scheme, no need to call super #146

Merged
merged 1 commit into from
Aug 5, 2022

Conversation

alexcwatt
Copy link
Contributor

When instantiating a GlobalId, the scheme has to be validated with check_scheme. Currently anything other than "gid" is invalid, and then if the string used is exactly "gid" we call super which ends up running some Regex in URI::Generic#check_scheme.

This PR is a small optimization - I don't think we need to call check_scheme, shouldn't "gid" always pass?

Here's the method in URI::Generic: https://github.com/ruby/ruby/blob/1e7a2415a4c69aa64c9c2a561197bf9cfc5a91f8/lib/uri/generic.rb#L320-L324

@rafaelfranca rafaelfranca merged commit 5da6355 into rails:main Aug 5, 2022
@alexcwatt alexcwatt deleted the update-check_scheme branch August 18, 2022 00:26
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