On Thu, Apr 28, 2016 at 3:52 PM, Aleksey Shipilev < [email protected]> wrote:
> *) next(): Missing braces in throw new NSEE() block;
> *) next(): Why loading this.a into local?
I agree with Aleksey but I'd go as far as to say that not only this.a is
unnecessary, but i as well. The body of next() looks too elaborate. This
seems equivalent and concise:
if (cursor >= a.length) {
throw new NoSuchElementException();
}
return a[cursor++];
Attila.
