[kservice ] Make it compile without foreach
ClosedPublic

Authored by mlaurent on Mar 19 2019, 8:36 PM.

Details

Summary

compile without foreach

Test Plan

autotest ok

Diff Detail

Repository
R309 KService
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mlaurent created this revision.Mar 19 2019, 8:36 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 19 2019, 8:36 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
mlaurent requested review of this revision.Mar 19 2019, 8:36 PM
dfaure accepted this revision.Mar 20 2019, 8:43 AM
dfaure added inline comments.
src/sycoca/vfolder_menu.cpp
125–126

This makes me realize that this code was indeed detaching a copy of items1.
Good catch.
But better code would use a java-style iterator and call remove(), to avoid the copy and the extra lookup at remove time.

This can be a separate commit, this port is correct.

This revision is now accepted and ready to land.Mar 20 2019, 8:43 AM
This revision was automatically updated to reflect the committed changes.