<div>apol added a comment.</div><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
color: #6B748C;
font-style: italic;
margin: 4px 0 12px 0;
padding: 8px 12px;
background-color: #F8F9FC;">
<div style="font-style: normal;
padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D1588#29377" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">D1588#29377</a>, <a href="https://phabricator.kde.org/p/davidedmundson/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;" rel="noreferrer">@davidedmundson</a> wrote:</div>
<div style="margin: 0;
padding: 0;
border: 0;
color: rgb(107, 116, 140);"><p>maybe we can, but why?</p>
<p>foreach is always correct</p>
<p>for is sometimes correct</p>
<p>what's the benefit?</p></div>
</blockquote>
<p>I tend to think along those lines... if it was actually a problem, it could just be specified as:</p>
<div class="remarkup-code-block" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="border: 1px solid #f1c40f;
background: #fdf5d4;
font-size: 10x;
padding: 8px;">#define Q_FOREACH(a, b) for((a) : qAsConst(b))</pre></div>
<p>And live happily ever after. Or at least, until they fix the weird copies. FWIW, it's discussed in qt-development@ as we're speaking.<br />
A direct improvement is about 100bytes less of generated code for every foreach (which then needs to be executed).</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>rPLASMAWORKSPACE Plasma Workspace</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D1588" rel="noreferrer">https://phabricator.kde.org/D1588</a></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>broulik, Plasma<br /><strong>Cc: </strong>apol, davidedmundson, plasma-devel, sebas<br /></div>