Explorar o código

fixed StringBuf.add("constant string") producing Std.string calls

Nicolas Cannasse %!s(int64=9) %!d(string=hai) anos
pai
achega
06ccf530b2
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      optimizer.ml

+ 1 - 0
optimizer.ml

@@ -74,6 +74,7 @@ let api_inline2 com c field params p =
 		Some { e with epos = p }
 		Some { e with epos = p }
 	| ([],"String"),"fromCharCode",[{ eexpr = TConst (TInt i) }] when i > 0l && i < 128l ->
 	| ([],"String"),"fromCharCode",[{ eexpr = TConst (TInt i) }] when i > 0l && i < 128l ->
 		Some (mk (TConst (TString (String.make 1 (char_of_int (Int32.to_int i))))) com.basic.tstring p)
 		Some (mk (TConst (TString (String.make 1 (char_of_int (Int32.to_int i))))) com.basic.tstring p)
+	| ([],"Std"),"string",[{ eexpr = TCast ({ eexpr = TConst c } as e, None)}]
 	| ([],"Std"),"string",[{ eexpr = TConst c } as e] ->
 	| ([],"Std"),"string",[{ eexpr = TConst c } as e] ->
 		(match c with
 		(match c with
 		| TString s ->
 		| TString s ->