[Folder View] Simplify clearing of lists
ClosedPublic

Authored by broulik on Apr 5 2018, 7:22 AM.

Details

Summary

Avoids triple lookup (contains → value → remove)
take() removes the item from the list and returns it. It returns nullptr for non-existing items which is perfectly fine to call delete on.

Test Plan

Compiles. Just found that local change I made months ago and been using forever with no issues.

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Apr 5 2018, 7:22 AM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 5 2018, 7:22 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Apr 5 2018, 7:22 AM
hein accepted this revision.Apr 5 2018, 11:59 AM
This revision is now accepted and ready to land.Apr 5 2018, 11:59 AM
This revision was automatically updated to reflect the committed changes.