Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Commit

Permalink
Replace Array#| with Array#+
Browse files Browse the repository at this point in the history
This is primarily for performance reasons. It yields around a 23%
improvement on a file with 300 violations.
  • Loading branch information
seancaffery committed Jan 9, 2015
1 parent b6a1248 commit 58feada
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ruby-lint/definition/ruby_object.rb
Expand Up @@ -697,7 +697,9 @@ def determine_parent(parent, type, name, exclude = [])
if parent.type == type and parent.name == name
parent_definition = parent
else
parent_definition = parent.lookup(type, name, true, exclude | [self])
exclude = exclude + [self] unless exclude.include?(self)

parent_definition = parent.lookup(type, name, true, exclude)
end

return parent_definition
Expand Down

0 comments on commit 58feada

Please sign in to comment.