Quote Originally Posted by iMalc View Post
I heard long ago of some compilers that more agressively optimise for loops, over while loops. Perhaps the author of this heard the same thing.
Not sure I even believed it though.

Not to mention that there are ways to do string comparisons for strings much better by using longer items than one char at a time.

And the "for()" keyword can actually be produced as a macro sort of like this (aside from putting the code inside the loop in the macro of course):
Code:
#define FOR(init, condition, update) init; while(condition)  { /* code in loop */; update; }
Since most of this is similar to "while", it's most likely that the optimizing part of the compiler does both for-loops and while-loops.

I find it more likely that the code was more complex to begin with, and got stepwise refined until this was what was left.

--
Mats