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

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

Issue 1979843002: Remove C::swap(C*) where C = Hash{Map,Set}<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: HeapTest compile fixes Created 4 years, 7 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 typedef HashTableIteratorAdapter<HashTableType, ValueType> iterator; 74 typedef HashTableIteratorAdapter<HashTableType, ValueType> iterator;
75 typedef HashTableConstIteratorAdapter<HashTableType, ValueType> const_iterat or; 75 typedef HashTableConstIteratorAdapter<HashTableType, ValueType> const_iterat or;
76 typedef typename HashTableType::AddResult AddResult; 76 typedef typename HashTableType::AddResult AddResult;
77 77
78 public: 78 public:
79 void swap(HashMap& ref) 79 void swap(HashMap& ref)
80 { 80 {
81 m_impl.swap(ref.m_impl); 81 m_impl.swap(ref.m_impl);
82 } 82 }
83 83
84 void swap(typename Allocator::template OtherType<HashMap>::Type other)
85 {
86 HashMap& ref = Allocator::getOther(other);
87 m_impl.swap(ref.m_impl);
88 }
89
90 unsigned size() const; 84 unsigned size() const;
91 unsigned capacity() const; 85 unsigned capacity() const;
92 void reserveCapacityForSize(unsigned size) 86 void reserveCapacityForSize(unsigned size)
93 { 87 {
94 m_impl.reserveCapacityForSize(size); 88 m_impl.reserveCapacityForSize(size);
95 } 89 }
96 90
97 bool isEmpty() const; 91 bool isEmpty() const;
98 92
99 // iterators iterate over pairs of keys and values 93 // iterators iterate over pairs of keys and values
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 iterator end = collection.end().values(); 499 iterator end = collection.end().values();
506 for (unsigned i = 0; it != end; ++it, ++i) 500 for (unsigned i = 0; it != end; ++it, ++i)
507 vector[i] = *it; 501 vector[i] = *it;
508 } 502 }
509 503
510 } // namespace WTF 504 } // namespace WTF
511 505
512 using WTF::HashMap; 506 using WTF::HashMap;
513 507
514 #endif // WTF_HashMap_h 508 #endif // WTF_HashMap_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapTest.cpp ('k') | third_party/WebKit/Source/wtf/HashSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698