lib/rubocop/cop/style/slicing_with_range.rb in rubocop-1.57.2 vs lib/rubocop/cop/style/slicing_with_range.rb in rubocop-1.58.0
- old
+ new
@@ -37,10 +37,10 @@
# @!method range_till_minus_one?(node)
def_node_matcher :range_till_minus_one?, '(irange !nil? (int -1))'
def on_send(node)
return unless node.arguments.count == 1
- return unless range_till_minus_one?(node.arguments.first)
+ return unless range_till_minus_one?(node.first_argument)
add_offense(node.first_argument) do |corrector|
corrector.remove(node.first_argument.end)
end
end