From de5b6d62b41685bb50810f35a6d6bf99023ae4ff Mon Sep 17 00:00:00 2001 From: Georgiy Sadovnikov Date: Fri, 28 Jun 2024 11:27:01 +0300 Subject: [PATCH] Adding optimization for arrays self assingnment --- tpl/bind_ecslite.twig | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tpl/bind_ecslite.twig b/tpl/bind_ecslite.twig index e90c146..18f47e0 100644 --- a/tpl/bind_ecslite.twig +++ b/tpl/bind_ecslite.twig @@ -109,8 +109,13 @@ {%- if token_or(f, 'bhl_set', 1) != 0 ~%} if(dv != null) { - {{ bhl_bind.val2native(f.type, 'dv', 'v') }}; - cmp.{{f.name}} = v; + {%- if f.type is instanceof('\\mtgArrType') -%} + if(dv._obj != null && !dv._obj.Equals(v)) + {%- endif ~%} + { + {{ bhl_bind.val2native(f.type, 'dv', 'v') }}; + cmp.{{f.name}} = v; + } dv.Release(); } {%- endif ~%}