lib/rubocop/cop/style/redundant_assignment.rb in rubocop-0.91.0 vs lib/rubocop/cop/style/redundant_assignment.rb in rubocop-0.91.1
- old
+ new
@@ -92,23 +92,15 @@
def check_begin_node(node)
if (assignment = redundant_assignment?(node))
add_offense(assignment) do |corrector|
expression = assignment.children[1]
corrector.replace(assignment, expression.source)
- corrector.remove(right_sibling_of(assignment))
+ corrector.remove(assignment.right_sibling)
end
else
last_expr = node.children.last
check_branch(last_expr)
end
- end
-
- def right_sibling_of(node)
- siblings_of(node)[node.sibling_index + 1]
- end
-
- def siblings_of(node)
- node.parent.children
end
end
end
end
end