Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Avoid unnecessary string allocation when calculating length #1454

Merged
merged 1 commit into from Sep 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/yard/registry_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ def lookup_path_inherited(namespace, path, type)

path.scan(split_on_separators_match).each do |part, sep|
cur_obj = nil
pos += "#{part}#{sep}".length
pos += part.length
pos += sep.length
parsed_end = pos == path.length

if !last_obj || (!parsed_end && !last_obj.is_a?(CodeObjects::NamespaceObject))
Expand Down