Răsfoiți Sursa

improve performance of string concat (fix wrong matching order)

frabbit 11 ani în urmă
părinte
comite
4f835df123
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      genpy.ml

+ 1 - 1
genpy.ml

@@ -1174,8 +1174,8 @@ module Printer = struct
 				in
 				let rec safe_string ex =
 					match ex.eexpr, ex.etype with
-						| TBinop(OpAdd, e1, e2), x when (is_type1 "" "String")(x) -> Printf.sprintf "(%s + %s)" (safe_string e1) (safe_string e2)
 						| e, _ when is_safe_string ex -> print_expr pctx ex
+						| TBinop(OpAdd, e1, e2), x when (is_type1 "" "String")(x) -> Printf.sprintf "(%s + %s)" (safe_string e1) (safe_string e2)
 						| _,x when (is_type1 "" "String")(x) -> Printf.sprintf "HxOverrides.stringOrNull(%s)" (print_expr pctx ex)
 						| _,_ -> Printf.sprintf "Std.string(%s)" (print_expr pctx ex)
 				in