3 ms·
Ah, I see what you mean. Yeah, that’s always awkward Not sure how you deal with that with for loops either. Increment the iteration var in the body of the loop
by akavi 7y ago
Ah, I see what you mean. Yeah, that’s always awkward
Not sure how you deal with that with for loops either. Increment the iteration var in the body of the loop? (Seems scary to me, but like I said, I’ve got terrible intuition with them)
- naasking 7y agoFor something like iterators: var ie1 = foo.GetEnumerator(); var ie2 = bar.GetEnumerator(); while(true) { var has1 = ie1.MoveNext(); var has2 = ie2.MoveNext(); if (!has1 && !has2) break; if (has1) // do something with ie1.Current if (has2) // do something with ie2.Current }