diff --git a/std/js/_std/haxe/ds/StringMap.hx b/std/js/_std/haxe/ds/StringMap.hx index 9e906491ad9..37f575a97ce 100644 --- a/std/js/_std/haxe/ds/StringMap.hx +++ b/std/js/_std/haxe/ds/StringMap.hx @@ -116,7 +116,7 @@ import haxe.DynamicAccess; } public inline function keys():Iterator { - return new StringMapKeyIterator(h); + return new haxe.iterators.ArrayIterator(Object.keys(h)); } public inline function iterator():Iterator { @@ -157,28 +157,6 @@ import haxe.DynamicAccess; } } -private class StringMapKeyIterator { - final h:Dynamic; - final keys:Array; - final length:Int; - var current:Int; - - public inline function new(h:Dynamic) { - this.h = h; - keys = Object.keys(h); - length = keys.length; - current = 0; - } - - public inline function hasNext():Bool { - return current < length; - } - - public inline function next():String { - return keys[current++]; - } -} - private class StringMapValueIterator { final h:Dynamic; final keys:Array;