4 ms·
What if someone changes "int" to "uint"? It wouldn't even infinite loop / crash... It would remove exactly one element! I can't see that. If i is a uint, at th
by tspiteri 15y ago
What if someone changes "int" to "uint"? It wouldn't even infinite loop / crash... It would remove exactly one element!
I can't see that. If i is a uint, at the end of the first cycle, i-- changes i to the maximum uint, then i++ changes i to 0, then i < Count compares Count to 0. It is identical to, if uglier than, the following:
while ( 0 < this.MyControl.TabPages.Count )
{
this.MyControl.TabPages.Remove ( this.MyControl.TabPages[0] );
}
- palish 15y agoOh, yep. That's correct, thanks.