On 8/29/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
moved space append so that final deletion is unnecessary. Minor javadoc and formatting changes.for (int i = 0; i < elements.length; ++i) { + if (i > 0) { + buffer.append(' '); + } ... buffer.append(relPath); - buffer.append(' '); - } - - // Get rid of trailing space, if any - if (buffer.length() > 0) { - buffer.setLength(buffer.length() - 1); }
I actually prefer my version Matt. Adding a test for all loop iterations to special case the first iteration always seemed not right to me. I prefer to remove the space unconditionally added, which is lightweight on a string buffer, than adding the test, especially when elements.length becomes large. A matter of taste I guess. --DD --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
