for-each loops are commonly used with string keys too, so I'm guessing that's why the code gets converted to a for-in loop. That would be fully compatible with both integer and string keys. I guess if the target is an Array or Vector, it would be possible to use a for(;;) loop instead. It could still potentially break on edge cases, though.
- Josh On Mon, Apr 25, 2016 at 12:37 AM, lizhi <s...@qq.com> wrote: > i do not konw the best code,but this code fast than now > > //slow code > var foreachiter0_target = this.ss; > for (var foreachiter0 in foreachiter0_target) > { > var s = foreachiter0_target[foreachiter0]; > { > }} > > //more fast code > var len=this.ss.length; > for(var i=0;i<len;i++){ > var s = this.ss[i]; > } > > > > -- > View this message in context: > http://apache-flex-development.2333347.n4.nabble.com/flexjs-foreach-very-slow-tp52571.html > Sent from the Apache Flex Development mailing list archive at Nabble.com. >