Przeglądaj źródła

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

Nicolas Cannasse 9 lat temu
rodzic
commit
06ccf530b2
1 zmienionych plików z 1 dodań i 0 usunięć
  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 }
 	| ([],"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)
+	| ([],"Std"),"string",[{ eexpr = TCast ({ eexpr = TConst c } as e, None)}]
 	| ([],"Std"),"string",[{ eexpr = TConst c } as e] ->
 		(match c with
 		| TString s ->