Re: StringBuffer/StringBuilder efficiency



On Thu, 01 Oct 2009 16:24:58 -0700, Patricia Shanahan <pats@xxxxxxx>
wrote, quoted or indirectly quoted someone who said :


How about giving the multi-append a new name, such as "appendAll"? That
way, append of an array would have the append(Object) meaning, but
appendAll of a string[] would append each of its elements.

You could also invent a new StringBuilder, called Cat that was
stripped down of backtracking logic for speed -- doing nothing but cat
(append) operations. However, it still needs the gluing core logic to
reside in String where it can allocate the final String char[] value
the correct size and copy the pieces in directly.
--
Roedy Green Canadian Mind Products
http://mindprod.com

When you can?t find a bug, you are probably looking in the wrong place. When you can?t find your glasses, you don?t keep scanning the same spot because you are convinced that is where you left them.
~ Roedy
.