class RuboCop::Cop::Performance::Detect
def autocorrect(corrector, node, replacement)
def autocorrect(corrector, node, replacement) receiver, _first_method = *node first_range = receiver.source_range.end.join(node.loc.selector) receiver, _args, _body = *receiver if receiver.block_type? corrector.remove(first_range) corrector.replace(receiver.loc.selector, replacement) end