| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 HashCountedSet<T, U, V, W>::add(const ValueType& value) { | 127 HashCountedSet<T, U, V, W>::add(const ValueType& value) { |
| 128 return add(value, 1u); | 128 return add(value, 1u); |
| 129 } | 129 } |
| 130 | 130 |
| 131 template <typename T, typename U, typename V, typename W> | 131 template <typename T, typename U, typename V, typename W> |
| 132 inline bool HashCountedSet<T, U, V, W>::remove(iterator it) { | 132 inline bool HashCountedSet<T, U, V, W>::remove(iterator it) { |
| 133 if (it == end()) | 133 if (it == end()) |
| 134 return false; | 134 return false; |
| 135 | 135 |
| 136 unsigned oldVal = it->value; | 136 unsigned oldVal = it->value; |
| 137 ASSERT(oldVal); | 137 DCHECK(oldVal); |
| 138 unsigned newVal = oldVal - 1; | 138 unsigned newVal = oldVal - 1; |
| 139 if (newVal) { | 139 if (newVal) { |
| 140 it->value = newVal; | 140 it->value = newVal; |
| 141 return false; | 141 return false; |
| 142 } | 142 } |
| 143 | 143 |
| 144 m_impl.remove(it); | 144 m_impl.remove(it); |
| 145 return true; | 145 return true; |
| 146 } | 146 } |
| 147 | 147 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 178 Vector<T> vector; | 178 Vector<T> vector; |
| 179 copyToVector(*this, vector); | 179 copyToVector(*this, vector); |
| 180 return vector; | 180 return vector; |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace WTF | 183 } // namespace WTF |
| 184 | 184 |
| 185 using WTF::HashCountedSet; | 185 using WTF::HashCountedSet; |
| 186 | 186 |
| 187 #endif // WTF_HashCountedSet_h | 187 #endif // WTF_HashCountedSet_h |
| OLD | NEW |