|
|
|
@@ -563,7 +563,7 @@ struct HashGenerator |
|
|
|
template <typename CharPointer>
|
|
|
|
static Type calculate (CharPointer t) noexcept
|
|
|
|
{
|
|
|
|
Type result = Type();
|
|
|
|
Type result = {};
|
|
|
|
|
|
|
|
while (! t.isEmpty())
|
|
|
|
result = ((Type) multiplier) * result + (Type) t.getAndAdvance();
|
|
|
|
@@ -574,9 +574,9 @@ struct HashGenerator |
|
|
|
enum { multiplier = sizeof (Type) > 4 ? 101 : 31 };
|
|
|
|
};
|
|
|
|
|
|
|
|
int String::hashCode() const noexcept { return HashGenerator<int> ::calculate (text); }
|
|
|
|
int64 String::hashCode64() const noexcept { return HashGenerator<int64> ::calculate (text); }
|
|
|
|
size_t String::hash() const noexcept { return HashGenerator<size_t> ::calculate (text); }
|
|
|
|
int String::hashCode() const noexcept { return (int) HashGenerator<uint32> ::calculate (text); }
|
|
|
|
int64 String::hashCode64() const noexcept { return (int64) HashGenerator<uint64> ::calculate (text); }
|
|
|
|
size_t String::hash() const noexcept { return HashGenerator<size_t> ::calculate (text); }
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
JUCE_API bool JUCE_CALLTYPE operator== (const String& s1, const String& s2) noexcept { return s1.compare (s2) == 0; }
|
|
|
|
|