Fast loop iteration


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // fastest way to iterate through a loop
  2. // - set var to :int
  3. // - count down from desired loop count to zero
  4. // - on each count we test the Boolean value of j (j<1 makes it false)
  5. // - instead of counting down with j-- we use j += -1 because adding negative
  6. // numbers is faster than subtracting
  7. //
  8.  
  9. for(var j:int=10; j; j += -1){}

URL: http://www.calypso88.com/?p=174

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.