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

Side by Side Diff: Source/wtf/HashCountedSet.h

Issue 138643003: Simpler return value of HashTable::add/HashMap:add and others (Closed)
Patch Set: Daily master update (now with base url?) Created 6 years, 10 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
« no previous file with comments | « Source/platform/weborigin/SecurityPolicy.cpp ('k') | Source/wtf/HashMap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 template<typename Value, typename HashFunctions, typename Traits> 147 template<typename Value, typename HashFunctions, typename Traits>
148 inline unsigned HashCountedSet<Value, HashFunctions, Traits>::count(const Va lueType& value) const 148 inline unsigned HashCountedSet<Value, HashFunctions, Traits>::count(const Va lueType& value) const
149 { 149 {
150 return m_impl.get(value); 150 return m_impl.get(value);
151 } 151 }
152 152
153 template<typename Value, typename HashFunctions, typename Traits> 153 template<typename Value, typename HashFunctions, typename Traits>
154 inline typename HashCountedSet<Value, HashFunctions, Traits>::AddResult Hash CountedSet<Value, HashFunctions, Traits>::add(const ValueType &value) 154 inline typename HashCountedSet<Value, HashFunctions, Traits>::AddResult Hash CountedSet<Value, HashFunctions, Traits>::add(const ValueType &value)
155 { 155 {
156 AddResult result = m_impl.add(value, 0); 156 AddResult result = m_impl.add(value, 0);
157 ++result.iterator->value; 157 ++result.storedValue->value;
158 return result; 158 return result;
159 } 159 }
160 160
161 template<typename Value, typename HashFunctions, typename Traits> 161 template<typename Value, typename HashFunctions, typename Traits>
162 inline bool HashCountedSet<Value, HashFunctions, Traits>::remove(const Value Type& value) 162 inline bool HashCountedSet<Value, HashFunctions, Traits>::remove(const Value Type& value)
163 { 163 {
164 return remove(find(value)); 164 return remove(find(value));
165 } 165 }
166 166
167 template<typename Value, typename HashFunctions, typename Traits> 167 template<typename Value, typename HashFunctions, typename Traits>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 for (unsigned i = 0; it != end; ++it, ++i) 228 for (unsigned i = 0; it != end; ++it, ++i)
229 vector[i] = (*it).key; 229 vector[i] = (*it).key;
230 } 230 }
231 231
232 232
233 } // namespace WTF 233 } // namespace WTF
234 234
235 using WTF::HashCountedSet; 235 using WTF::HashCountedSet;
236 236
237 #endif /* WTF_HashCountedSet_h */ 237 #endif /* WTF_HashCountedSet_h */
OLDNEW
« no previous file with comments | « Source/platform/weborigin/SecurityPolicy.cpp ('k') | Source/wtf/HashMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698