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

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

Issue 1363653006: Reserve capacity for static strings HashMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the deduced string length (exclude NULL terminator) Created 5 years, 2 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 void swap(typename Allocator::template OtherType<HashMap>::Type other) 92 void swap(typename Allocator::template OtherType<HashMap>::Type other)
93 { 93 {
94 HashMap& ref = Allocator::getOther(other); 94 HashMap& ref = Allocator::getOther(other);
95 m_impl.swap(ref.m_impl); 95 m_impl.swap(ref.m_impl);
96 } 96 }
97 97
98 unsigned size() const; 98 unsigned size() const;
99 unsigned capacity() const; 99 unsigned capacity() const;
100 void reserveCapacityForSize(unsigned size)
101 {
102 m_impl.reserveCapacityForSize(size);
103 }
104
100 bool isEmpty() const; 105 bool isEmpty() const;
101 106
102 // iterators iterate over pairs of keys and values 107 // iterators iterate over pairs of keys and values
103 iterator begin(); 108 iterator begin();
104 iterator end(); 109 iterator end();
105 const_iterator begin() const; 110 const_iterator begin() const;
106 const_iterator end() const; 111 const_iterator end() const;
107 112
108 HashMapKeysProxy& keys() { return static_cast<HashMapKeysProxy&>(*this); } 113 HashMapKeysProxy& keys() { return static_cast<HashMapKeysProxy&>(*this); }
109 const HashMapKeysProxy& keys() const { return static_cast<const HashMapKeysP roxy&>(*this); } 114 const HashMapKeysProxy& keys() const { return static_cast<const HashMapKeysP roxy&>(*this); }
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 struct NeedsTracing<HashMap<T, U, V, W, X>> { 507 struct NeedsTracing<HashMap<T, U, V, W, X>> {
503 static const bool value = false; 508 static const bool value = false;
504 }; 509 };
505 #endif 510 #endif
506 511
507 } // namespace WTF 512 } // namespace WTF
508 513
509 using WTF::HashMap; 514 using WTF::HashMap;
510 515
511 #endif // WTF_HashMap_h 516 #endif // WTF_HashMap_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/InitModules.cpp ('k') | third_party/WebKit/Source/wtf/MainThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698