Ignore:
Timestamp:
2018-07-05T21:41:23Z (7 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0fe0f32
Parents:
5608106c
git-author:
Dzejrou <dzejrou@…> (2018-05-14 17:03:57)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:23)
Message:

cpp: fixed bugs found by the map tests

File:
1 edited

Legend:

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

    r5608106c r21d97e8  
    7878            rbtree_iterator& operator++()
    7979            {
     80                if (end_)
     81                    return *this;
     82
    8083                if (current_)
    8184                {
     
    102105                if (end_)
    103106                {
    104                     try_undo_end_();
     107                    end_ = false;
    105108
    106109                    return *this;
     
    145148            node_type* current_;
    146149            bool end_;
    147 
    148             void try_undo_end_()
    149             {
    150                 if (!current_)
    151                     return;
    152 
    153                 /**
    154                  * We can do this if we are past end().
    155                  * This means we are the largest.
    156                  */
    157                 if (current_->find_largest() == current_)
    158                     end_ = false;
    159             }
    160150    };
    161151
     
    224214            rbtree_const_iterator& operator++()
    225215            {
     216                if (end_)
     217                    return *this;
     218
    226219                if (current_)
    227220                {
     
    248241                if (end_)
    249242                {
    250                     try_undo_end_();
     243                    end_ = false;
    251244
    252245                    return *this;
     
    286279            const node_type* current_;
    287280            bool end_;
    288 
    289             void try_undo_end_()
    290             {
    291                 if (!current_)
    292                     return;
    293 
    294                 /**
    295                  * We can do this if we are past end().
    296                  * This means we are the largest.
    297                  */
    298                 if (current_->find_largest() == current_)
    299                     end_ = false;
    300             }
    301281    };
    302282
Note: See TracChangeset for help on using the changeset viewer.