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

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

Issue 14877006: Optimization of HashTraits<RefPtr<P> >::emptyValue() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased. Created 7 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
« no previous file with comments | « no previous file | Source/wtf/HashTraits.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, 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 swap(a.value, b.value); 296 swap(a.value, b.value);
297 } 297 }
298 298
299 template<typename T, bool useSwap> struct Mover; 299 template<typename T, bool useSwap> struct Mover;
300 template<typename T> struct Mover<T, true> { static void move(T& from, T& to ) { hashTableSwap(from, to); } }; 300 template<typename T> struct Mover<T, true> { static void move(T& from, T& to ) { hashTableSwap(from, to); } };
301 template<typename T> struct Mover<T, false> { static void move(T& from, T& t o) { to = from; } }; 301 template<typename T> struct Mover<T, false> { static void move(T& from, T& t o) { to = from; } };
302 302
303 template<typename HashFunctions> class IdentityHashTranslator { 303 template<typename HashFunctions> class IdentityHashTranslator {
304 public: 304 public:
305 template<typename T> static unsigned hash(const T& key) { return HashFun ctions::hash(key); } 305 template<typename T> static unsigned hash(const T& key) { return HashFun ctions::hash(key); }
306 template<typename T> static bool equal(const T& a, const T& b) { return HashFunctions::equal(a, b); } 306 template<typename T, typename U> static bool equal(const T& a, const U& b) { return HashFunctions::equal(a, b); }
307 template<typename T, typename U> static void translate(T& location, cons t U&, const T& value) { location = value; } 307 template<typename T, typename U> static void translate(T& location, cons t U&, const T& value) { location = value; }
308 }; 308 };
309 309
310 template<typename IteratorType> struct HashTableAddResult { 310 template<typename IteratorType> struct HashTableAddResult {
311 HashTableAddResult(IteratorType iter, bool isNewEntry) : iterator(iter), isNewEntry(isNewEntry) { } 311 HashTableAddResult(IteratorType iter, bool isNewEntry) : iterator(iter), isNewEntry(isNewEntry) { }
312 IteratorType iterator; 312 IteratorType iterator;
313 bool isNewEntry; 313 bool isNewEntry;
314 }; 314 };
315 315
316 template<typename Key, typename Value, typename Extractor, typename HashFunc tions, typename Traits, typename KeyTraits> 316 template<typename Key, typename Value, typename Extractor, typename HashFunc tions, typename Traits, typename KeyTraits>
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1417 inline bool operator!=(const HashTableIteratorAdapter<T, U>& a, const HashTa bleConstIteratorAdapter<T, U>& b) 1417 inline bool operator!=(const HashTableIteratorAdapter<T, U>& a, const HashTa bleConstIteratorAdapter<T, U>& b)
1418 { 1418 {
1419 return a.m_impl != b.m_impl; 1419 return a.m_impl != b.m_impl;
1420 } 1420 }
1421 1421
1422 } // namespace WTF 1422 } // namespace WTF
1423 1423
1424 #include <wtf/HashIterators.h> 1424 #include <wtf/HashIterators.h>
1425 1425
1426 #endif // WTF_HashTable_h 1426 #endif // WTF_HashTable_h
OLDNEW
« no previous file with comments | « no previous file | Source/wtf/HashTraits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698