D24171: [src/filewidgets/*] replace deprecated foreach with range for

David Faure noreply at phabricator.kde.org
Sat Sep 28 21:08:28 BST 2019


dfaure added inline comments.

INLINE COMMENTS

> kfilepreviewgenerator.cpp:733
>      // to use their default MIME type icon.
> -    foreach (const QUrl &url, m_cutItemsCache.keys()) {
> -        const QModelIndex index = dirModel->indexForUrl(url);
> +    auto it = m_cutItemsCache.keys().cbegin();
> +    for (; it != m_cutItemsCache.keys().cend(); ++it) {

keys() is what is slow (it creates and fills a temporary container)

You want m_cutItemsCache.cbegin()

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D24171

To: ahmadsamir, kde-frameworks-devel, dfaure
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190928/bbdceca9/attachment.html>


More information about the Kde-frameworks-devel mailing list