Browse Source

Worked around a compiler warning

tags/2021-05-28
jules 8 years ago
parent
commit
383c1678ce
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      modules/juce_core/text/juce_String.cpp

+ 4
- 4
modules/juce_core/text/juce_String.cpp 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; }


Loading…
Cancel
Save