ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.com>
Subject Re: svn commit: r438081 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ManifestClassPath.java
Date Tue, 29 Aug 2006 17:49:43 GMT
On 8/29/06, mbenson@apache.org <mbenson@apache.org> 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: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message