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

Side by Side Diff: third_party/WebKit/Source/wtf/text/StringHash.h

Issue 1798913002: WTF HashSet: Implement move semantics for values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 9 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 | « third_party/WebKit/Source/wtf/text/AtomicString.cpp ('k') | no next file » | 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) 2006, 2007, 2008, 2012, 2013 Apple Inc. All rights reserved 2 * Copyright (C) 2006, 2007, 2008, 2012, 2013 Apple Inc. All rights reserved
3 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 static unsigned hash(const LChar* data, unsigned length) 84 static unsigned hash(const LChar* data, unsigned length)
85 { 85 {
86 return StringHasher::computeHashAndMaskTop8Bits<LChar, foldCase<LChar>>( data, length); 86 return StringHasher::computeHashAndMaskTop8Bits<LChar, foldCase<LChar>>( data, length);
87 } 87 }
88 88
89 static inline unsigned hash(const char* data, unsigned length) 89 static inline unsigned hash(const char* data, unsigned length)
90 { 90 {
91 return CaseFoldingHash::hash(reinterpret_cast<const LChar*>(data), lengt h); 91 return CaseFoldingHash::hash(reinterpret_cast<const LChar*>(data), lengt h);
92 } 92 }
93 93
94 static inline unsigned hash(const char* data)
95 {
96 return CaseFoldingHash::hash(reinterpret_cast<const LChar*>(data), strle n(data));
97 }
98
94 static inline bool equal(const StringImpl* a, const StringImpl* b) 99 static inline bool equal(const StringImpl* a, const StringImpl* b)
95 { 100 {
96 return equalIgnoringCaseNonNull(a, b); 101 return equalIgnoringCaseNonNull(a, b);
97 } 102 }
98 103
99 static unsigned hash(const RefPtr<StringImpl>& key) 104 static unsigned hash(const RefPtr<StringImpl>& key)
100 { 105 {
101 return hash(key.get()); 106 return hash(key.get());
102 } 107 }
103 108
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 166 }
162 }; 167 };
163 168
164 } // namespace WTF 169 } // namespace WTF
165 170
166 using WTF::AlreadyHashed; 171 using WTF::AlreadyHashed;
167 using WTF::CaseFoldingHash; 172 using WTF::CaseFoldingHash;
168 using WTF::StringHash; 173 using WTF::StringHash;
169 174
170 #endif 175 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/text/AtomicString.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698