Port away from Qt's foreach all loops over method-local containers
ClosedPublic

Authored by kossebau on Sep 2 2019, 8:48 AM.

Details

Summary

The simple porting, as those containers are not shared with anyone,
so the removal of the container copying has no risks

Diff Detail

Repository
R39 KTextEditor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Sep 2 2019, 8:48 AM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptSep 2 2019, 8:48 AM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
kossebau requested review of this revision.Sep 2 2019, 8:48 AM
kossebau added a comment.EditedSep 2 2019, 9:00 AM

There are quite a lot of foreachs in ktexteditor, so IMHO it makes sense to split up the porting in multiple commits, so in case of regressions one can bisect in the overall changes a bit and then has fewer changes to reason about where something might have been broken.
So my plan for further commits is:

  • one commit where method-local copies would be made explicit ,where currently they are done implicitly in the foreach() by some call -> minimal risk, as not shared
  • commits where new structures are generated by iterating shared containers, without method calls which might modify the containers potentially
  • commits per classes/submodules where each change needs careful review, as recursive non-const calls happen

Splitting up the changes also makes review easier/more manageable in smaller time units hopefully :)

cullmann accepted this revision.Sep 2 2019, 12:14 PM
cullmann added a subscriber: cullmann.

Looks ok for me, thanks for taking care.

This revision is now accepted and ready to land.Sep 2 2019, 12:14 PM
This revision was automatically updated to reflect the committed changes.

Also did a review and it looks good to me, thanks!