Skip to content

Commit

Permalink
performance fix for js
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Oct 6, 2024
1 parent 2a18e3a commit 609c489
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hscript/Interp.hx
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,11 @@ class Interp {
function makeIterator( v : Dynamic ) : Iterator<Dynamic> {
#if ((flash && !flash9) || (php && !php7 && haxe_ver < '4.0.0'))
if ( v.iterator != null ) v = v.iterator();
#elseif js
// don't use try/catch (very slow)
if( v is Array )
return (v : Array<Dynamic>).iterator();
if( v.iterator != null ) v = v.iterator();
#else
try v = v.iterator() catch( e : Dynamic ) {};
#end
Expand Down

0 comments on commit 609c489

Please sign in to comment.