The array length could be cached in a local variable in this case as well.