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

Use require_relative in the Racc codebase #269

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

koic
Copy link
Contributor

@koic koic commented Jun 5, 2024

If there are many searches in the $LOAD_PATH in the user environment, require will perform unnecessary searches that are not needed. In contrast, require_relative is efficient because it uses a relative path.

Racc requires Ruby 2.5+, it is possible to use require_relative, which was introduced in Ruby 1.9.
https://github.com/ruby/racc/blob/v1.8.0/racc.gemspec#L44

If there are many searches in the `$LOAD_PATH` in the user environment,
require will perform unnecessary searches that are not needed.
In contrast, `require_relative` is efficient because it uses a relative path.

Racc requires Ruby 2.5+, it is possible to use `require_relative`,
which was introduced in Ruby 1.9.
https://github.com/ruby/racc/blob/v1.8.0/racc.gemspec#L44
@flavorjones flavorjones merged commit 489ddae into ruby:master Jun 5, 2024
28 checks passed
@koic koic deleted the use_require_relative branch June 5, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants