ruby / racc

Racc is an LALR(1) parser generator. It is written in Ruby itself, and generates ruby programs.
Other
535 stars 88 forks source link

Use `require_relative` in the Racc codebase #269

Closed koic closed 3 months ago

koic commented 3 months ago

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