View Single Post
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#11
Originally Posted by attila77 View Post
Another suggestion is to avoid the classic C counter construct and at() or []. Use

foreach (QString s, temp) {
...
}

Faster, less error prone, easier to parallelize later on.
Faster? As in "Faster to write" or something else?

I agree on this construction being less error prone but faster is not something I'd connect to it.

The "foreach" construction is syntactical sugar, as far as I know, and as fast, or slower, than regular indexing. With a normal compiler, I'd guess "just as fast" but not "faster".