Ignore:
Timestamp:
Jan 23, 2013, 9:36:03 PM (8 years ago)
Author:
sam
Message:

base: optimise array concatenation, fix string concatenation, and fix
string concatenation unit tests.

File:
1 edited

Legend:

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

    r2267 r2269  
    119119    inline String& operator +=(String const &s)
    120120    {
    121         /* Ignore the trailing zero we don't want */
    122         --m_count;
    123         (Super &)*this += (Super const &)s;
     121        int old_count = Count();
     122        Resize(Count() + s.Count());
     123        memcpy(&(*this)[old_count], &s[0], Count() - old_count);
    124124        return *this;
    125125    }
Note: See TracChangeset for help on using the changeset viewer.