Replace each Q_FOREACH and foreach by the range based for statement from the c++ 11 standard . Shouldn't change anything performance wise. But it's now persistent across the repository.
Details
Details
Diff Detail
Diff Detail
- Repository
- R76 PIM: Event Views
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 4459 Build 4477: arc lint + arc unit
Comment Actions
Replacing Q_FOREACH with range-based for actually might change performance, in case the data structure detaches. Basically, Q_FOREACH creates a const copy of the container and iterates over that, so no detaching happens.
Since you did not use a single qAsConst, you might be interested in https://www.kdab.com/goodbye-q_foreach/. OTOH, not using it is sometimes correct, e.g. if you iterate over an already const container or if you are extra careful that no detaching happens in the body (which might change in the future, though).
Comment Actions
I rewrote two times this patch with each time a smaller subset of change, and i had some strange segfault. Probably because of qt Ptr.