rubocops/cask: Make names, the list of method names in on_*, a Set

Co-authored-by: Markus Reiter <me@reitermark.us>
This commit is contained in:
Issy Long 2023-03-20 23:53:20 +00:00
parent 0b7bd81959
commit deb8a13a73
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -33,7 +33,7 @@ module RuboCop
end
def on_system_stanzas(on_system)
names = []
names = Set.new
method_nodes = on_system.map(&:method_node)
method_nodes.each do |node|
next unless node.block_type?
@ -42,7 +42,7 @@ module RuboCop
child.each_node(:send) do |send_node|
next if ON_SYSTEM_METHODS.include?(send_node.method_name)
names << send_node.method_name
names.add(send_node.method_name)
end
end
end