lib/rubocop/cop/performance/compare_with_block.rb in rubocop-0.50.0 vs lib/rubocop/cop/performance/compare_with_block.rb in rubocop-0.51.0
- old
+ new
@@ -44,11 +44,15 @@
def on_block(node)
compare?(node) do |send, var_a, var_b, body|
replaceable_body?(body, var_a, var_b) do |method, args_a, args_b|
return unless slow_compare?(method, args_a, args_b)
range = compare_range(send, node)
- add_offense(node, range,
- message(send, method, var_a, var_b, args_a))
+
+ add_offense(
+ node,
+ location: range,
+ message: message(send, method, var_a, var_b, args_a)
+ )
end
end
end
def autocorrect(node)