lib/array: remember the last used iterator so it could be used again
authorJean Privat <jean@pryen.org>
Fri, 6 Mar 2015 15:33:22 +0000 (22:33 +0700)
committerJean Privat <jean@pryen.org>
Fri, 6 Mar 2015 15:33:22 +0000 (22:33 +0700)
commit852c59df9934205a45b01381c070728f375d6900
tree753c2265f1ef3294f5b5a15a50988cd79c67eef3
parent6e549a2629c75122184fe861b8214922ddec2739
lib/array: remember the last used iterator so it could be used again

on nitc/nitc/nit this reduce a lot the number of allocated iterators.

before:

* 0m7.168s
* 2,706,498 new ArrayIterator
* the second most allocated class (after NativeArray)

after:

* 0m7.060s (-1.5%)
* 785,781 new ArrayIterator (-70%)
* the 7th most allocated class

Signed-off-by: Jean Privat <jean@pryen.org>
lib/standard/collection/array.nit