class RuboCop::Cop::Performance::ChainArrayAllocation

def on_send(node)

def on_send(node)
  chain_array_allocation?(node) do |fm, sm|
    return if node.each_descendant(:send).any? { |descendant| descendant.method?(:lazy) }
    return if node.method?(:select) && !enumerable_select_method?(node.receiver)
    range = node.loc.selector.begin.join(node.source_range.end)
    add_offense(range, message: format(MSG, method: fm, second_method: sm))
  end
end