| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com> | 4 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com> |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 const_reverse_iterator rend() const { | 234 const_reverse_iterator rend() const { |
| 235 return makeConstReverseIterator(anchor()); | 235 return makeConstReverseIterator(anchor()); |
| 236 } | 236 } |
| 237 | 237 |
| 238 Value& front(); | 238 Value& front(); |
| 239 const Value& front() const; | 239 const Value& front() const; |
| 240 void removeFirst(); | 240 void removeFirst(); |
| 241 | 241 |
| 242 Value& back(); | 242 Value& back(); |
| 243 const Value& back() const; | 243 const Value& back() const; |
| 244 void removeLast(); | 244 void pop_back(); |
| 245 | 245 |
| 246 iterator find(ValuePeekInType); | 246 iterator find(ValuePeekInType); |
| 247 const_iterator find(ValuePeekInType) const; | 247 const_iterator find(ValuePeekInType) const; |
| 248 bool contains(ValuePeekInType) const; | 248 bool contains(ValuePeekInType) const; |
| 249 | 249 |
| 250 // An alternate version of find() that finds the object by hashing and | 250 // An alternate version of find() that finds the object by hashing and |
| 251 // comparing with some other type, to avoid the cost of type conversion. | 251 // comparing with some other type, to avoid the cost of type conversion. |
| 252 // The HashTranslator interface is defined in HashSet. | 252 // The HashTranslator interface is defined in HashSet. |
| 253 template <typename HashTranslator, typename T> | 253 template <typename HashTranslator, typename T> |
| 254 iterator find(const T&); | 254 iterator find(const T&); |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 return lastNode()->m_value; | 723 return lastNode()->m_value; |
| 724 } | 724 } |
| 725 | 725 |
| 726 template <typename T, typename U, typename V, typename W> | 726 template <typename T, typename U, typename V, typename W> |
| 727 inline const T& LinkedHashSet<T, U, V, W>::back() const { | 727 inline const T& LinkedHashSet<T, U, V, W>::back() const { |
| 728 DCHECK(!isEmpty()); | 728 DCHECK(!isEmpty()); |
| 729 return lastNode()->m_value; | 729 return lastNode()->m_value; |
| 730 } | 730 } |
| 731 | 731 |
| 732 template <typename T, typename U, typename V, typename W> | 732 template <typename T, typename U, typename V, typename W> |
| 733 inline void LinkedHashSet<T, U, V, W>::removeLast() { | 733 inline void LinkedHashSet<T, U, V, W>::pop_back() { |
| 734 DCHECK(!isEmpty()); | 734 DCHECK(!isEmpty()); |
| 735 m_impl.remove(static_cast<Node*>(m_anchor.m_prev)); | 735 m_impl.remove(static_cast<Node*>(m_anchor.m_prev)); |
| 736 } | 736 } |
| 737 | 737 |
| 738 template <typename T, typename U, typename V, typename W> | 738 template <typename T, typename U, typename V, typename W> |
| 739 inline typename LinkedHashSet<T, U, V, W>::iterator | 739 inline typename LinkedHashSet<T, U, V, W>::iterator |
| 740 LinkedHashSet<T, U, V, W>::find(ValuePeekInType value) { | 740 LinkedHashSet<T, U, V, W>::find(ValuePeekInType value) { |
| 741 LinkedHashSet::Node* node = | 741 LinkedHashSet::Node* node = |
| 742 m_impl.template lookup<LinkedHashSet::NodeHashFunctions, ValuePeekInType>( | 742 m_impl.template lookup<LinkedHashSet::NodeHashFunctions, ValuePeekInType>( |
| 743 value); | 743 value); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 swap(static_cast<Base&>(a), static_cast<Base&>(b)); | 929 swap(static_cast<Base&>(a), static_cast<Base&>(b)); |
| 930 swap(a.m_value, b.m_value); | 930 swap(a.m_value, b.m_value); |
| 931 Allocator::leaveGCForbiddenScope(); | 931 Allocator::leaveGCForbiddenScope(); |
| 932 } | 932 } |
| 933 | 933 |
| 934 } // namespace WTF | 934 } // namespace WTF |
| 935 | 935 |
| 936 using WTF::LinkedHashSet; | 936 using WTF::LinkedHashSet; |
| 937 | 937 |
| 938 #endif /* WTF_LinkedHashSet_h */ | 938 #endif /* WTF_LinkedHashSet_h */ |
| OLD | NEW |