Show
Ignore:
Timestamp:
07/30/08 15:12:45 (5 months ago)
Author:
odole
Message:

merge with webkit revision 35445

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/JavaScriptCore/wtf/Vector.h

    r414 r424  
    3737    using std::max; 
    3838     
     39    const size_t notFound = static_cast<size_t>(-1); 
     40 
    3941    template <bool needsDestruction, typename T> 
    4042    class VectorDestructor; 
     
    461463        const T& last() const { return at(size() - 1); } 
    462464 
    463         template<typename U> iterator find(const U& value) { return std::find(begin(), end(), value); } 
    464         template<typename U> const_iterator find(const U& value) const { return std::find(begin(), end(), value); } 
     465        template<typename U> size_t find(const U&) const; 
    465466 
    466467        void shrink(size_t size); 
     
    586587 
    587588        return *this; 
     589    } 
     590 
     591    template<typename T, size_t inlineCapacity> 
     592    template<typename U> 
     593    size_t Vector<T, inlineCapacity>::find(const U& value) const 
     594    { 
     595        for (size_t i = 0; i < size(); ++i) { 
     596            if (at(i) == value) 
     597                return i; 
     598        } 
     599        return notFound; 
    588600    } 
    589601