Use const_iterator
ClosedPublic

Authored by gladhorn on Sep 12 2019, 8:07 PM.

Details

Reviewers
zzag
Group Reviewers
KWin
Commits
R127:28841048d555: Use const_iterator
Summary

When trivial, replace iterators with the const version.

Diff Detail

Repository
R127 KWayland
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
gladhorn created this revision.Sep 12 2019, 8:07 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptSep 12 2019, 8:07 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
gladhorn requested review of this revision.Sep 12 2019, 8:07 PM
zzag added a subscriber: zzag.Sep 12 2019, 8:10 PM
zzag added inline comments.
src/server/output_interface.cpp
118–119

constEnd

zzag added inline comments.Sep 12 2019, 8:12 PM
src/client/registry.cpp
879

constEnd

If the container is const already there's no real reason to explicitly use constBegin which is effectively the same

zzag added a comment.Sep 12 2019, 8:45 PM

If the container is const already there's no real reason to explicitly use constBegin which is effectively the same

Yes, however it's still a good idea to be explicit about it.

Yes, for me always using constBegin/constEnd makes reading the code slightly easier.

src/client/registry.cpp
879

Thanks!

src/server/output_interface.cpp
118–119

Thanks!

gladhorn updated this revision to Diff 66021.Sep 14 2019, 8:29 AM
gladhorn edited the summary of this revision. (Show Details)
gladhorn removed subscribers: broulik, zzag.

Fixed two missing spots

zzag accepted this revision.Sep 14 2019, 8:44 AM
This revision is now accepted and ready to land.Sep 14 2019, 8:44 AM
This revision was automatically updated to reflect the committed changes.