D11828: Simplify orPostingIterator and make it faster

Stefan BrĂ¼ns noreply at phabricator.kde.org
Fri Apr 6 18:57:10 UTC 2018


bruns added inline comments.

INLINE COMMENTS

> orpostingiterator.cpp:44
>  {
> -    m_docId = 0;
> -    if (m_iterators.isEmpty()) {
> -        return 0;
> +    // first call
> +    if (m_nextId == 0) {

Move this to the constructor?

> orpostingiterator.cpp:47
> +        for (auto it = m_iterators.cbegin(), end = m_iterators.cend(); it != end; it++) {
> +            auto docId = (*it)->next();
> +            // find smallest docId

iterator may contain nullptr's

REPOSITORY
  R293 Baloo

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

To: bruns, #baloo
Cc: #frameworks, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, alexeymin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180406/ae627f9d/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list