diff --git a/Gemfile b/Gemfile index 099d5086b76..f1a65b02aa5 100644 --- a/Gemfile +++ b/Gemfile @@ -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. diff --git a/lib/rubocop/yaml_duplication_checker.rb b/lib/rubocop/yaml_duplication_checker.rb index e54f8996107..eef9969f008 100644 --- a/lib/rubocop/yaml_duplication_checker.rb +++ b/lib/rubocop/yaml_duplication_checker.rb @@ -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