<table><tr><td style="">broulik created this revision.<br />broulik added reviewers: Plasma, hein.<br />Restricted Application added a project: Plasma.<br />Restricted Application added a subscriber: plasma-devel.<br />broulik requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D11946">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Avoids triple lookup (contains → value → remove)<br />
<tt style="background: #ebebeb; font-size: 13px;">take()</tt> removes the item from the list and returns it. It returns <tt style="background: #ebebeb; font-size: 13px;">nullptr</tt> for non-existing items which is perfectly fine to call <tt style="background: #ebebeb; font-size: 13px;">delete</tt> on.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Compiles. Just found that local change I made months ago and been using forever with no issues.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R119 Plasma Desktop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D11946">https://phabricator.kde.org/D11946</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>containments/desktop/plugins/folder/foldermodel.cpp</div></div></div><br /><div><strong>To: </strong>broulik, Plasma, hein<br /><strong>Cc: </strong>plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>