Skip to content

Commit

Permalink
fixup! fixup! [Fix rubocop#255] Fix a false positive for `Style/Redun…
Browse files Browse the repository at this point in the history
…dantEqualityComparisonBlock`
  • Loading branch information
koic committed Aug 10, 2021
1 parent cd08f3e commit 5c34c21
Showing 1 changed file with 3 additions and 7 deletions.
Expand Up @@ -90,13 +90,9 @@ def use_block_argument_in_method_argument_of_operand?(block_argument, operand)
return false unless operand.send_type?

arguments = operand.arguments
operand_sources = arguments.map(&:source)

arguments.each do |argument|
operand_sources += argument.each_descendant(:lvar).map(&:source)
end

operand_sources.any?(block_argument.source)
arguments.inject(arguments.map(&:source)) do |operand_sources, argument|
operand_sources + argument.each_descendant(:lvar).map(&:source)
end.any?(block_argument.source)
end

def offense_range(node)
Expand Down

0 comments on commit 5c34c21

Please sign in to comment.