Return to Snippet

Revision: 15443
at July 6, 2009 09:28 by weavermedia


Initial Code
// fastest way to iterate through a loop
// - set var to :int
// - count down from desired loop count to zero
// - on each count we test the Boolean value of j (j<1 makes it false)
// - instead of counting down with j-- we use j += -1 because adding negative
//   numbers is faster than subtracting
//

for(var j:int=10; j; j += -1){}

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

Initial Description


Initial Title
Fast loop iteration

Initial Tags


Initial Language
ActionScript 3