class RuboCop::Cop::Performance::Casecmp

def build_good_method(method, arg, variable)

def build_good_method(method, arg, variable)
  bang = method == :!= ? '!' : ''
  # We want resulting call to be parenthesized
  # if arg already includes one or more sets of parens, don't add more
  # or if method call already used parens, again, don't add more
  if arg.send_type? || !parentheses?(arg)
    "#{bang}#{variable.source}.casecmp(#{arg.source}).zero?"
  else
    "#{bang}#{variable.source}.casecmp#{arg.source}.zero?"
  end
end