aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/ArrayReverseIterator.hx
blob: 9976c6ab2ccde20d357a7ffa821353d76686fc35 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package utils;

class ArrayReverseIterator<T> {
	final arr:Array<T>;
	var i:Int;

	public inline function new(arr:Array<T>) {
		this.arr = arr;
		this.i = this.arr.length - 1;
	}

	public inline function hasNext() {
		return i > -1;
	}

	public inline function next() {
		return arr[i--];
	}
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage