java.lang.String#contentEquals(CharSequence) suboptimal?

Jesús Viñuales serverperformance at gmail.com
Mon Jan 4 17:20:48 UTC 2010


> That's true, but given cs is a String with length equal to this,
> cs.equals(this) nevertheless may return false, and
> 
>  if (cs.equals(this))
>   return true;
> 
> will not return. The remaining code performs the comparison a second
> time in this case.

Oh, now I see it - you are absolutely right :-)




More information about the core-libs-dev mailing list