Implementation
Efficiency
A slow version of a for-loop is used.
Efficiency
Consider the following code taken from these Efficiency tips:
static class Foo {
int mSplat;
}
Foo[] mArray = ...
public void two() {
int sum = 0;
for (Foo a : mArray) {
sum += a.mSplat;
}
}
This is the fastest for devices without JIT and indistinguishable from one()
for devices with a JIT.
But consider a hand-written counted loop for Efficiency-critical ArrayList iteration.