bruns added inline comments. INLINE COMMENTS
> smithjd wrote in indexcleaner.cpp:76 > This example will also detach with or without a const intermediate. > > > ...returning a copy from a method means that the copy is shared and has > > negative side-effects when used with range-based loops. - > > https://www.dvratil.cz/2015/06/qt-containers-and-c11-range-based-loops No, if done correctly, it will not detach. For iterating, you need a readonly copy of the container. Using `const auto` gurantees you will not modify the container. Calling begin() on a const Qt container will not detach. Try to understand the linked article. REPOSITORY R293 Baloo REVISION DETAIL https://phabricator.kde.org/D11529 To: smithjd, #baloo, vhanda, michaelh, broulik, bruns Cc: bruns, kde-frameworks-devel, mgallien, ashaposhnikov, michaelh, astippich, spoorun, ngraham, abrahams