From 97385f27bdaac0ce06039ee575b7f17730efc0b5 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 3 May 2023 04:30:10 -0400 Subject: [PATCH] Fix Performance/RedundantEqualityComparisonBlock cop (#24799) --- .rubocop_todo.yml | 6 ------ spec/requests/link_headers_spec.rb | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 52b15c9bced..f2a5cf4c42e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -327,12 +327,6 @@ Performance/MethodObjectAsBlock: - 'app/models/account_suggestions/source.rb' - 'spec/models/export_spec.rb' -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AllowRegexpMatch. -Performance/RedundantEqualityComparisonBlock: - Exclude: - - 'spec/requests/link_headers_spec.rb' - # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: MaxKeyValuePairs. Performance/RedundantMerge: diff --git a/spec/requests/link_headers_spec.rb b/spec/requests/link_headers_spec.rb index c32e0f79a93..a1327d8db3a 100644 --- a/spec/requests/link_headers_spec.rb +++ b/spec/requests/link_headers_spec.rb @@ -26,7 +26,7 @@ describe 'Link headers' do def link_header_with_type(type) LinkHeader.parse(response.headers['Link'].to_s).links.find do |link| - link.attr_pairs.any? { |pair| pair == ['type', type] } + link.attr_pairs.any?(['type', type]) end end end