Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: third_party/WebKit/Source/wtf/HashTable.h

Issue 1477023003: Refactor the Heap into ThreadHeap to prepare for per thread heaps Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 HashTable& operator=(const HashTable&); 428 HashTable& operator=(const HashTable&);
429 429
430 // When the hash table is empty, just return the same iterator for end as 430 // When the hash table is empty, just return the same iterator for end as
431 // for begin. This is more efficient because we don't have to skip all the 431 // for begin. This is more efficient because we don't have to skip all the
432 // empty and deleted buckets, and iterating an empty table is a common case 432 // empty and deleted buckets, and iterating an empty table is a common case
433 // that's worth optimizing. 433 // that's worth optimizing.
434 iterator begin() { return isEmpty() ? end() : makeIterator(m_table); } 434 iterator begin() { return isEmpty() ? end() : makeIterator(m_table); }
435 iterator end() { return makeKnownGoodIterator(m_table + m_tableSize); } 435 iterator end() { return makeKnownGoodIterator(m_table + m_tableSize); }
436 const_iterator begin() const { return isEmpty() ? end() : makeConstIterator( m_table); } 436 const_iterator begin() const { return isEmpty() ? end() : makeConstIterator( m_table); }
437 const_iterator end() const { return makeKnownGoodConstIterator(m_table + m_t ableSize); } 437 const_iterator end() const { return makeKnownGoodConstIterator(m_table + m_t ableSize); }
438 ValueType* table() const { return m_table; }
haraken 2016/01/07 08:06:22 Ditto.
438 439
439 unsigned size() const 440 unsigned size() const
440 { 441 {
441 ASSERT(!m_accessForbidden); 442 ASSERT(!m_accessForbidden);
442 return m_keyCount; 443 return m_keyCount;
443 } 444 }
444 unsigned capacity() const 445 unsigned capacity() const
445 { 446 {
446 ASSERT(!m_accessForbidden); 447 ASSERT(!m_accessForbidden);
447 return m_tableSize; 448 return m_tableSize;
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 CollectionIterator end(toBeRemoved.end()); 1490 CollectionIterator end(toBeRemoved.end());
1490 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it) 1491 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it)
1491 collection.remove(*it); 1492 collection.remove(*it);
1492 } 1493 }
1493 1494
1494 } // namespace WTF 1495 } // namespace WTF
1495 1496
1496 #include "wtf/HashIterators.h" 1497 #include "wtf/HashIterators.h"
1497 1498
1498 #endif // WTF_HashTable_h 1499 #endif // WTF_HashTable_h
OLDNEW
« third_party/WebKit/Source/wtf/HashSet.h ('K') | « third_party/WebKit/Source/wtf/HashSet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698