Skip to content

Commit

Permalink
Suppress new Style/MapToSet offense
Browse files Browse the repository at this point in the history
Follow up rubocop/rubocop#11735.

This PR suppresses the following new `Style/MapToSet` offense:

```console
% bundle exec rubocop
(snip)

Offenses:

lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb:41:33: C: [Correctable] Style/MapToSet: Pass a block to to_set instead of calling map.to_set.
            set = node.children.map(&:child).to_set.freeze
                                ^^^

163 files inspected, 1 offense detected, 1 offense autocorrectable
```
  • Loading branch information
koic committed Mar 27, 2023
1 parent fe90ac1 commit 1484462
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb
Expand Up @@ -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

Expand Down

0 comments on commit 1484462

Please sign in to comment.