2
0
Эх сурвалжийг харах

Speedup array unsafe_get and unsafe_set for object types. Closes https://github.com/HaxeFoundation/hxcpp/issues/145

hughsando 10 жил өмнө
parent
commit
a285600aa1
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      gencpp.ml

+ 1 - 1
gencpp.ml

@@ -2080,7 +2080,7 @@ and gen_expression ctx retval expression =
          match func.eexpr with
          match func.eexpr with
             | TField(obj,field) when is_array obj.etype ->
             | TField(obj,field) when is_array obj.etype ->
                (match field_name field with
                (match field_name field with
-                  | "pop" | "shift" -> check_array_element_cast obj.etype ".StaticCast" "()"
+                  | "pop" | "shift" | "__unsafe_get" | "__unsafe_set" -> check_array_element_cast obj.etype ".StaticCast" "()"
                   | "map" -> check_array_cast expression.etype
                   | "map" -> check_array_cast expression.etype
                   | _ -> ()
                   | _ -> ()
                )
                )