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

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

Issue 1477213003: More switching to standard type traits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Excluded WTF::IsSubclass from the patch Created 4 years, 11 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/Vector.h ('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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 return (a == b) || equal(a.impl(), b.impl()); 120 return (a == b) || equal(a.impl(), b.impl());
121 } 121 }
122 122
123 static const bool safeToCompareToEmptyOrDeleted = false; 123 static const bool safeToCompareToEmptyOrDeleted = false;
124 124
125 private: 125 private:
126 // Private so no one uses this in the belief that it will return the 126 // Private so no one uses this in the belief that it will return the
127 // correctly-folded code point in all cases (see comment below). 127 // correctly-folded code point in all cases (see comment below).
128 template<typename T> static inline UChar foldCase(T ch) 128 template<typename T> static inline UChar foldCase(T ch)
129 { 129 {
130 if (IsSameType<T, LChar>::value) 130 if (std::is_same<T, LChar>::value)
131 return StringImpl::latin1CaseFoldTable[ch]; 131 return StringImpl::latin1CaseFoldTable[ch];
132 // It's possible for WTF::Unicode::foldCase() to return a 32-bit value 132 // It's possible for WTF::Unicode::foldCase() to return a 32-bit value
133 // that's not representable as a UChar. However, since this is rare and 133 // that's not representable as a UChar. However, since this is rare and
134 // deterministic, and the result of this is merely used for hashing, go 134 // deterministic, and the result of this is merely used for hashing, go
135 // ahead and clamp the value. 135 // ahead and clamp the value.
136 return static_cast<UChar>(WTF::Unicode::foldCase(ch)); 136 return static_cast<UChar>(WTF::Unicode::foldCase(ch));
137 } 137 }
138 }; 138 };
139 139
140 // This hash can be used in cases where the key is a hash of a string, but we 140 // This hash can be used in cases where the key is a hash of a string, but we
(...skipping 16 matching lines...) Expand all
157 } 157 }
158 }; 158 };
159 159
160 } 160 }
161 161
162 using WTF::AlreadyHashed; 162 using WTF::AlreadyHashed;
163 using WTF::CaseFoldingHash; 163 using WTF::CaseFoldingHash;
164 using WTF::StringHash; 164 using WTF::StringHash;
165 165
166 #endif 166 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/Vector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698