Hello,

Have to agree with Fabian handling CharSequences (and special case 
StringBuilder) is pretty weak, in CharBuffer.append(CharSequence) you see the 
same toString. I would expect it to do:
- Instamceof String -> use it
- Instance of StringBuilder -> extract char[] and iterate
- Instance of CharBuffer -> handle
- Otherwise: Loop over charAt

(the otherwise might be a tradeof between allocation and (not)inlined bounds 
checks) 

Alternative would be a CharSequence.fillInto(char[])

BTW wouldn't it be create if char[] implements CharSequence?

Gruss
Bernd
-- 
http://bernd.eckenfels.net
>From Win 10 Mobile

Von: Fabian Lange

Reply via email to