Ignore:
Timestamp:
2018-07-05T21:41:23Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cf573ec
Parents:
27f1bc0
git-author:
Dzejrou <dzejrou@…> (2018-05-13 23:27:05)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:23)
Message:

cpp: fixed end(), it was broken because of the change to node lists for multi tables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/internal/rbtree.hpp

    r27f1bc0 r4f22d0c3  
    125125            iterator end()
    126126            {
    127                 return iterator{find_largest_(), true};
     127                /**
     128                 * In case we have lists of nodes
     129                 * we need to get the actual end
     130                 * from the largest node.
     131                 */
     132                auto res = find_largest_();
     133                if (res)
     134                    return iterator{res->get_end(), true};
     135                else
     136                    return iterator{res, true};
    128137            }
    129138
     
    160169            const_iterator cend() const
    161170            {
    162                 return const_iterator{find_largest_(), true};
     171                auto res = find_largest_();
     172                if (res)
     173                    return const_iterator{res->get_end(), true};
     174                else
     175                    return const_iterator{res, true};
    163176            }
    164177
Note: See TracChangeset for help on using the changeset viewer.