| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 281 |
| 282 template <typename IncomingValueType> | 282 template <typename IncomingValueType> |
| 283 AddResult insertBefore(ValuePeekInType beforeValue, | 283 AddResult insertBefore(ValuePeekInType beforeValue, |
| 284 IncomingValueType&& newValue); | 284 IncomingValueType&& newValue); |
| 285 template <typename IncomingValueType> | 285 template <typename IncomingValueType> |
| 286 AddResult insertBefore(iterator it, IncomingValueType&& newValue) { | 286 AddResult insertBefore(iterator it, IncomingValueType&& newValue) { |
| 287 return m_impl.template add<NodeHashFunctions>( | 287 return m_impl.template add<NodeHashFunctions>( |
| 288 std::forward<IncomingValueType>(newValue), it.getNode()); | 288 std::forward<IncomingValueType>(newValue), it.getNode()); |
| 289 } | 289 } |
| 290 | 290 |
| 291 void remove(ValuePeekInType); | 291 void erase(ValuePeekInType); |
| 292 void remove(iterator); | 292 void erase(iterator); |
| 293 void clear() { m_impl.clear(); } | 293 void clear() { m_impl.clear(); } |
| 294 template <typename Collection> | 294 template <typename Collection> |
| 295 void removeAll(const Collection& other) { | 295 void removeAll(const Collection& other) { |
| 296 WTF::removeAll(*this, other); | 296 WTF::removeAll(*this, other); |
| 297 } | 297 } |
| 298 | 298 |
| 299 template <typename VisitorDispatcher> | 299 template <typename VisitorDispatcher> |
| 300 void trace(VisitorDispatcher visitor) { | 300 void trace(VisitorDispatcher visitor) { |
| 301 m_impl.trace(visitor); | 301 m_impl.trace(visitor); |
| 302 // Should the underlying table be moved by GC, register a callback | 302 // Should the underlying table be moved by GC, register a callback |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 template <typename T, typename U, typename V, typename W> | 858 template <typename T, typename U, typename V, typename W> |
| 859 template <typename IncomingValueType> | 859 template <typename IncomingValueType> |
| 860 typename LinkedHashSet<T, U, V, W>::AddResult | 860 typename LinkedHashSet<T, U, V, W>::AddResult |
| 861 LinkedHashSet<T, U, V, W>::insertBefore(ValuePeekInType beforeValue, | 861 LinkedHashSet<T, U, V, W>::insertBefore(ValuePeekInType beforeValue, |
| 862 IncomingValueType&& newValue) { | 862 IncomingValueType&& newValue) { |
| 863 return insertBefore(find(beforeValue), | 863 return insertBefore(find(beforeValue), |
| 864 std::forward<IncomingValueType>(newValue)); | 864 std::forward<IncomingValueType>(newValue)); |
| 865 } | 865 } |
| 866 | 866 |
| 867 template <typename T, typename U, typename V, typename W> | 867 template <typename T, typename U, typename V, typename W> |
| 868 inline void LinkedHashSet<T, U, V, W>::remove(iterator it) { | 868 inline void LinkedHashSet<T, U, V, W>::erase(iterator it) { |
| 869 if (it == end()) | 869 if (it == end()) |
| 870 return; | 870 return; |
| 871 m_impl.remove(it.getNode()); | 871 m_impl.remove(it.getNode()); |
| 872 } | 872 } |
| 873 | 873 |
| 874 template <typename T, typename U, typename V, typename W> | 874 template <typename T, typename U, typename V, typename W> |
| 875 inline void LinkedHashSet<T, U, V, W>::remove(ValuePeekInType value) { | 875 inline void LinkedHashSet<T, U, V, W>::erase(ValuePeekInType value) { |
| 876 remove(find(value)); | 876 erase(find(value)); |
| 877 } | 877 } |
| 878 | 878 |
| 879 inline void swapAnchor(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b) { | 879 inline void swapAnchor(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b) { |
| 880 DCHECK(a.m_prev); | 880 DCHECK(a.m_prev); |
| 881 DCHECK(a.m_next); | 881 DCHECK(a.m_next); |
| 882 DCHECK(b.m_prev); | 882 DCHECK(b.m_prev); |
| 883 DCHECK(b.m_next); | 883 DCHECK(b.m_next); |
| 884 swap(a.m_prev, b.m_prev); | 884 swap(a.m_prev, b.m_prev); |
| 885 swap(a.m_next, b.m_next); | 885 swap(a.m_next, b.m_next); |
| 886 if (b.m_next == &a) { | 886 if (b.m_next == &a) { |
| (...skipping 42 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 |