- Code: Select all
for ( int I = iTotal; --I >= 0; ) {
// Do something.
}
Couldn't this be used as well?
- Code: Select all
for ( int I = -1; ++I < iTotal; ) {
// Do something.
}
Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo
for ( int I = iTotal; --I >= 0; ) {
// Do something.
}
for ( int I = -1; ++I < iTotal; ) {
// Do something.
}
L. Spiro wrote:In my left hand is a red pill. If you take it I will show you the truth. I lost my right hand in the war, so I’m afraid you’re stuck with the red pill.
CoMPMStR wrote:Well the only thing I can think of that can be any faster is using a prefix operation.
- Code: Select all
for ( int I = iTotal; --I >= 0; ) {
// Do something.
}
CoMPMStR wrote:Couldn't this be used as well?
- Code: Select all
for ( int I = -1; ++I < iTotal; ) {
// Do something.
}
L. Spiro wrote:P. S.: For some reason the 100% form of the unsigned loop does not work in L. Spiro Script. It skips index 0.
I will investigate and fix later but be warned that you can not use the unsigned form yet.
You can, however, use the signed form.
int iTotal = 10;
for(int I = iTotal; I--;) {
PrintF("%d", I);
}
L. Spiro wrote:In my left hand is a red pill. If you take it I will show you the truth. I lost my right hand in the war, so I’m afraid you’re stuck with the red pill.
Users browsing this forum: No registered users and 0 guests