diff --git a/lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb b/lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb index e8221e912..20342e661 100644 --- a/lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb +++ b/lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb @@ -38,7 +38,7 @@ def visit_positional_parameter end def visit_set - set = node.children.map(&:child).to_set.freeze + set = node.children.to_set(&:child).freeze NodePattern::Sets[set] end