Re: Looping over arrays.

From: Roedy Green (roedy_at_seewebsite.com)
Date: 11/24/03


Date: Mon, 24 Nov 2003 18:54:01 GMT

On 24 Nov 2003 02:42:09 -0800, johndoe666_341@hotmail.com (Marc Twain)
wrote or quoted :

>This way the length of the array doesn't have to be recalculated on
>every iteration? Or am I completely wrong?

A clever compiler or hotspotter will likely do that optimisation for
you. Doing it yourself often just clutters the code. Optimise for
clarity, then if there is a problem, for speed.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming. 
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.