4 ms·
> // iterate over our arguments > .iter() hmmm. Not far off the old > i++ // add one to i
by Chris2048 10y ago
> // iterate over our arguments
> .iter()
hmmm. Not far off the old
> i++ // add one to i
- tatterdemalion 10y agoThese are quite different. `.iter()` is equivalent to creating the counter and declaring both the increment and conclusion condition, only its guaranteed to correctly access each member of the collection once and to never be broken, and for many collections (e.g. arrays) it is written in a way which allows for powerful optimizations.
- Chris2048 10y agoI mean in terms of comment useful-ness.