Review Request 115018: Use the QMap iterator instead of foreach(key, map.keys()).
Emmanuel Pescosta
emmanuelpescosta099 at gmail.com
Wed Jan 15 14:00:14 GMT 2014
> On Jan. 15, 2014, 2:52 p.m., Frank Reininghaus wrote:
> > Thanks for the patch! I first thought that replacing the foreach loop would probably not affect the performance much, but when iterating the keys of a QMap, rather than, e.g., the elements of a QVector, it saves the creation of the temporary list returned by itemStates.keys() (I guess that this was also the explanation that Thiago gave - maybe it was in a private discussion, Mark? I could not see any comment from Thiago here).
> >
> > One could in principle move the declaration of 'it' into the for statement, but I assume that you did not do this in order to prevent that the line gets too long? Either solution is fine for me.
> to prevent that the line gets too long?
Yes exactly. Smth. for Dolphin > 4.x, when C++11 auto is allowed ;)
- Emmanuel
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115018/#review47446
-----------------------------------------------------------
On Jan. 15, 2014, 1:03 a.m., Emmanuel Pescosta wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115018/
> -----------------------------------------------------------
>
> (Updated Jan. 15, 2014, 1:03 a.m.)
>
>
> Review request for Dolphin.
>
>
> Repository: kde-baseapps
>
>
> Description
> -------
>
> Use the QMap iterator instead of foreach(key, map.keys()) in UpdateItemStatesThread::run() and in VersionControlObserver::slotThreadFinished().
>
>
> Diffs
> -----
>
> dolphin/src/views/versioncontrol/updateitemstatesthread.cpp 6be07d3
> dolphin/src/views/versioncontrol/versioncontrolobserver.cpp 4d939ee
>
> Diff: https://git.reviewboard.kde.org/r/115018/diff/
>
>
> Testing
> -------
>
> Works ;)
>
>
> Thanks,
>
> Emmanuel Pescosta
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20140115/0c12352f/attachment.htm>
More information about the kfm-devel
mailing list