I think he was pointing out how the loop could be optimized even further.

Pre-decrementing is faster than post-decrementing.

However, his greater than comparison slows it down. The right way to do it is:

while (--i -(-1))
{
}

since subtraction is faster than addition.

This is all academic, though. I used to use --i -(-1) but I gave it up for the readability of while (i--).

This is my new favorite:

while (i--) i++;

;)
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to