Skip to content

Commit

Permalink
Bump RuboCop Performance to 1.12.0
Browse files Browse the repository at this point in the history
This commit bumps RuboCop Performance to 1.12.0 and suppresses
the following offense.

```console
% bundle exec rubocop -a lib/rubocop/yaml_duplication_checker.rb
Inspecting 1 file
C

Offenses:

lib/rubocop/yaml_duplication_checker.rb:26:11: C: [Corrected]
Performance/RedundantBlockCall: Use yield instead of on_duplicated.call.
          on_duplicated.call(exist, key) if exist
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1 file inspected, 1 offense detected, 1 offense corrected
```
  • Loading branch information
koic committed Oct 31, 2021
1 parent 25c95e6 commit 48e163d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -8,7 +8,7 @@ gem 'bump', require: false
gem 'memory_profiler', platform: :mri
gem 'rake', '~> 13.0'
gem 'rspec', '~> 3.7'
gem 'rubocop-performance', '~> 1.11.0'
gem 'rubocop-performance', '~> 1.12.0'
gem 'rubocop-rake', '~> 0.6.0'
gem 'rubocop-rspec', '~> 2.5.0'
# Workaround for cc-test-reporter with SimpleCov 0.18.
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/yaml_duplication_checker.rb
Expand Up @@ -23,7 +23,7 @@ def self.traverse(tree, &on_duplicated)
when Psych::Nodes::Mapping
tree.children.each_slice(2).with_object([]) do |(key, value), keys|
exist = keys.find { |key2| key2.value == key.value }
on_duplicated.call(exist, key) if exist
yield(exist, key) if exist
keys << key
traverse(value, &on_duplicated)
end
Expand Down

0 comments on commit 48e163d

Please sign in to comment.