diff options
author | Steve Block <steveblock@google.com> | 2011-05-25 19:08:45 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-08 13:51:31 +0100 |
commit | 2bde8e466a4451c7319e3a072d118917957d6554 (patch) | |
tree | 28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/JavaScriptCore/wtf/Vector.h | |
parent | 6939c99b71d9372d14a0c74a772108052e8c48c8 (diff) | |
download | external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2 |
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'Source/JavaScriptCore/wtf/Vector.h')
-rw-r--r-- | Source/JavaScriptCore/wtf/Vector.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/JavaScriptCore/wtf/Vector.h b/Source/JavaScriptCore/wtf/Vector.h index 2fb4114..b26857c 100644 --- a/Source/JavaScriptCore/wtf/Vector.h +++ b/Source/JavaScriptCore/wtf/Vector.h @@ -40,7 +40,7 @@ namespace WTF { using std::max; // WTF_ALIGN_OF / WTF_ALIGNED - #if COMPILER(GCC) || COMPILER(MINGW) || COMPILER(RVCT) || COMPILER(WINSCW) + #if COMPILER(GCC) || COMPILER(MINGW) || COMPILER(RVCT) || COMPILER(WINSCW) || COMPILER(SUNCC) #define WTF_ALIGN_OF(type) __alignof__(type) #define WTF_ALIGNED(variable_type, variable, n) variable_type variable __attribute__((__aligned__(n))) #elif COMPILER(MSVC) @@ -566,6 +566,7 @@ namespace WTF { T& last() { return at(size() - 1); } const T& last() const { return at(size() - 1); } + template<typename U> bool contains(const U&) const; template<typename U> size_t find(const U&) const; template<typename U> size_t reverseFind(const U&) const; @@ -745,6 +746,13 @@ namespace WTF { template<typename T, size_t inlineCapacity> template<typename U> + bool Vector<T, inlineCapacity>::contains(const U& value) const + { + return find(value) != notFound; + } + + template<typename T, size_t inlineCapacity> + template<typename U> size_t Vector<T, inlineCapacity>::find(const U& value) const { for (size_t i = 0; i < size(); ++i) { |