ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Glick <jesse.gl...@oracle.com>
Subject Re: svn commit: r1066963 - in /ant/core/trunk/src/main/org/apache/tools: ant/ ant/taskdefs/ ant/taskdefs/cvslib/ ant/taskdefs/email/ ant/taskdefs/optional/ ant/taskdefs/optional/depend/ ant/taskdefs/optional/depend/constantpool/ ant/taskdefs/optional/i18n/...
Date Fri, 04 Feb 2011 19:35:42 GMT
On 02/04/2011 09:03 AM, Antoine Levy-Lambert wrote:
> I did not know that using a final variable for the upper bound of a loop instead of something.size()
makes a difference in terms of performance.

Generally the preferred idiom is to use an iterator, which the Java 5 for loop would do if
we were not source="1.4". (In the quoted case you are iterating two lists at 
once so an enhanced for loop would not suffice but Iterator can still be used. In a few other
cases the index is needed for another purpose so using an Iterator is less 
desirable.)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message