| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |