diff --git a/src/BloomFilter.cpp b/src/BloomFilter.cpp index d7cb2b1..af65259 100644 --- a/src/BloomFilter.cpp +++ b/src/BloomFilter.cpp @@ -105,16 +105,16 @@ bool BloomFilter::contains(const string &element) { static unsigned int djb2Hash(const string &text) { unsigned int hash = 5381; - for (const char &iterator : text) { - hash = ((hash << 5) + hash) + iterator; + for (auto ch : text) { + hash = ((hash << 5) + hash) + static_cast(ch); } return hash; } static unsigned int sdbmHash(const string &text) { unsigned int hash = 0; - for (const char &iterator : text) { - hash = iterator + ((hash << 6) + (hash << 16) - hash); + for (auto ch : text) { + hash = static_cast(ch) + ((hash << 6) + (hash << 16) - hash); } return hash; } @@ -151,4 +151,4 @@ static vector readVectorFromStream(BinaryInputStream &in) { size_t BloomFilter::getBitCount() const { return bitCount; -} \ No newline at end of file +}