1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-15 00:24:19 +00:00

Worked around a compiler warning

This commit is contained in:
jules 2017-08-23 10:06:56 +01:00
parent d59ac51067
commit 383c1678ce

View file

@ -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; }