diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/PositionCache.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index ea281f7ab..e9edb84e7 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -723,10 +723,11 @@ bool PositionCacheEntry::Retrieve(unsigned int styleNumber_, const char *s_, } unsigned int PositionCacheEntry::Hash(unsigned int styleNumber_, const char *s, unsigned int len_) noexcept { - unsigned int ret = s[0] << 7; + const unsigned char *us = reinterpret_cast<const unsigned char *>(s); + unsigned int ret = us[0] << 7; for (unsigned int i=0; i<len_; i++) { ret *= 1000003; - ret ^= s[i]; + ret ^= us[i]; } ret *= 1000003; ret ^= len_; |