Explorar el Código

[js] optimize Type.getEnumConstructs

Dan Korostelev hace 9 años
padre
commit
e7c6a8e6df
Se han modificado 1 ficheros con 2 adiciones y 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 {