Explorar o código

[js] optimize Type.getEnumConstructs

Dan Korostelev %!s(int64=9) %!d(string=hai) anos
pai
achega
e7c6a8e6df
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      std/js/_std/Type.hx

+ 2 - 3
std/js/_std/Type.hx

@@ -144,9 +144,8 @@ enum ValueType {
 		return a;
 	}
 
-	public static function getEnumConstructs( e : Enum<Dynamic> ) : Array<String> {
-		var a : Array<String> = untyped e.__constructs__;
-		return a.copy();
+	public static inline function getEnumConstructs( e : Enum<Dynamic> ) : Array<String> {
+		return ((cast e).__constructs__ : Array<String>).copy();
 	}
 
 	public static function typeof( v : Dynamic ) : ValueType untyped {