class RuboCop::Cop::Performance::Detect

def on_send(node)

def on_send(node)
  detect_candidate?(node) do |receiver, second_method, args|
    if second_method == :[]
      index = args
      args = {}
    end
    return unless args.empty?
    return unless receiver
    receiver, _args, body = *receiver if receiver.block_type?
    return if accept_first_call?(receiver, body)
    register_offense(node, receiver, second_method, index)
  end
end