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

class ArrayKeyValueReverseIterator<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 {value: arr[i], key: i--};
	}
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage