OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2008 David Levin <levin@chromium.org> | 3 * Copyright (C) 2008 David Levin <levin@chromium.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1270 { | 1270 { |
1271 return a.m_impl == b.m_impl; | 1271 return a.m_impl == b.m_impl; |
1272 } | 1272 } |
1273 | 1273 |
1274 template<typename T, typename U> | 1274 template<typename T, typename U> |
1275 inline bool operator!=(const HashTableIteratorAdapter<T, U>& a, const HashTa
bleConstIteratorAdapter<T, U>& b) | 1275 inline bool operator!=(const HashTableIteratorAdapter<T, U>& a, const HashTa
bleConstIteratorAdapter<T, U>& b) |
1276 { | 1276 { |
1277 return a.m_impl != b.m_impl; | 1277 return a.m_impl != b.m_impl; |
1278 } | 1278 } |
1279 | 1279 |
| 1280 template<typename Collection1, typename Collection2> |
| 1281 inline void removeAll(Collection1& collection, const Collection2& toBeRemove
d) |
| 1282 { |
| 1283 if (collection.isEmpty() || toBeRemoved.isEmpty()) |
| 1284 return; |
| 1285 typedef typename Collection2::const_iterator CollectionIterator; |
| 1286 CollectionIterator end(toBeRemoved.end()); |
| 1287 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it) |
| 1288 collection.remove(*it); |
| 1289 } |
| 1290 |
1280 } // namespace WTF | 1291 } // namespace WTF |
1281 | 1292 |
1282 #include "wtf/HashIterators.h" | 1293 #include "wtf/HashIterators.h" |
1283 | 1294 |
1284 #endif // WTF_HashTable_h | 1295 #endif // WTF_HashTable_h |
OLD | NEW |