Changeset 14184 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
May 4, 2006, 1:37:09 PM (19 years ago)
Author:
andersca
Message:

2006-05-04 Anders Carlsson <[email protected]>

Reviewed by Maciej.

http://bugzilla.opendarwin.org/show_bug.cgi?id=8734
Would like a Vector::append that takes another Vector


  • kxmlcore/Vector.h: (KXMLCore::::append): New function that takes another array.
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r14162 r14184  
     12006-05-04  Anders Carlsson  <[email protected]>
     2
     3        Reviewed by Maciej.
     4
     5        http://bugzilla.opendarwin.org/show_bug.cgi?id=8734
     6        Would like a Vector::append that takes another Vector
     7       
     8        * kxmlcore/Vector.h:
     9        (KXMLCore::::append):
     10        New function that takes another array.
     11
    1122006-05-02  Steve Falkenburg  <[email protected]>
    213
  • trunk/JavaScriptCore/kxmlcore/Vector.h

    r13832 r14184  
    379379
    380380        template<typename U> void append(const U&);
     381        template<typename U> void append(const Vector<U>&);
    381382        template<typename U> void insert(size_t position, const U&);
    382383        void remove(size_t position);
     
    545546    }
    546547
     548    template<typename T, size_t inlineCapacity> template<typename U>
     549    inline void Vector<T, inlineCapacity>::append(const Vector<U>& val)
     550    {
     551        if (size() + val.size() >= capacity())
     552            expandCapacity(size() + val.size());
     553        for (unsigned i = 0; i < val.size(); i++)
     554            append(val[i]);
     555    }
     556   
    547557    template<typename T, size_t inlineCapacity> template<typename U>
    548558    inline void Vector<T, inlineCapacity>::insert(size_t position, const U& val)
Note: See TracChangeset for help on using the changeset viewer.