Comment Comment by pcwalton Because in the former case, the optimizer has to prove that the length of the array cannot change during the body of the loop, while in the latter case, that's guaranteed by the language semantics. parent pcwalton 9 years ago