package haxe.iterators; import haxe.ds.HashMap; class HashMapKeyValueIterator { final map:HashMap; final keys:Iterator; public inline function new(map:HashMap) { this.map = map; this.keys = map.keys(); } /** See `Iterator.hasNext` **/ public inline function hasNext():Bool { return keys.hasNext(); } /** See `Iterator.next` **/ public inline function next():{key:K, value:V} { var key = keys.next(); return {value: map.get(key), key: key}; } }