From b82aad097a8e295cefeff13c3d1953f27c4d5e11 Mon Sep 17 00:00:00 2001 From: Jaime Humberto Macias Bustamante Date: Sat, 10 Jan 2026 20:35:20 -0700 Subject: [PATCH] Property resolve optimization --- hscript/Interp.hx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hscript/Interp.hx b/hscript/Interp.hx index e6627be..6acf788 100644 --- a/hscript/Interp.hx +++ b/hscript/Interp.hx @@ -620,7 +620,7 @@ class Interp { } inline function getProperty(o:Null, n:String, allowProperty:Bool = true):Dynamic { - if(o != null && allowProperty && o is Property) + if(allowProperty && o != null && o is Property) return cast(o, Property).callGetter(n); else return o; @@ -644,12 +644,12 @@ class Interp { } } - for(map in [variables, publicVariables, staticVariables]) { - if(map.exists(id)) { - var r:Null = map.get(id); - return getProperty(r, id, allowProperty); - } - } + if (variables.exists(id)) + return getProperty(variables.get(id), id, allowProperty); + if (publicVariables.exists(id)) + return getProperty(publicVariables.get(id), id, allowProperty); + if (staticVariables.exists(id)) + return getProperty(staticVariables.get(id), id, allowProperty); if(customClasses.exists(id)) return customClasses.get(id);