Hi! Two issues with this cop:
'HOLA'.downcase == 'hola' gets autocorrected to 'HOLA'.casecmp('hola'), but the first version returns a boolean and the second an integer.'HOLA'.casecmp('hola') == 0 which is arguably less readable. I think performance cops should only be enabled by defaulf if they don't harm readability.What if it autocorrected to 'HOLA'.casecmp('hola').zero? ?
I still find it less readable, but it's not up to me... :)
@segiddins, since this cop is for "performance", could you benchmark the zero? fix and see if it still buys any performance?
Most helpful comment
I still find it less readable, but it's not up to me... :)