Changeset 3825


Ignore:
Timestamp:
Feb 18, 2015, 12:19:23 PM (7 years ago)
Author:
sam
Message:

base: fix a data loss bug in the avl_tree copy constructor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lol/base/avl_tree.h

    r3824 r3825  
    4040    avl_tree & operator=(avl_tree const & other)
    4141    {
    42         clear();
    43 
    44         for (auto it : other)
    45             insert(it.key, it.value);
     42        if (&other != this)
     43        {
     44            clear();
     45
     46            for (auto it : other)
     47                insert(it.key, it.value);
     48        }
    4649
    4750        return *this;
Note: See TracChangeset for help on using the changeset viewer.