diff options
author | Neil <nyamatongwe@gmail.com> | 2019-07-02 08:00:09 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-07-02 08:00:09 +1000 |
commit | 4da4a98e632f8b62534a9ac3923e036cf48abe77 (patch) | |
tree | 419e17969b837550ffe24fa2ea3f9f4c7a7a2d44 | |
parent | f23fa56d86fa3af91198c93647883522bcdefe4c (diff) | |
download | scintilla-mirror-4da4a98e632f8b62534a9ac3923e036cf48abe77.tar.gz |
Backport: Bug [#2115]. Backed out changeset: d70ccc4f172a as not undefined behaviour.
Backport of changeset 7618:45ca8e288e55.
-rw-r--r-- | src/PositionCache.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index 03393536d..8910a2955 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -615,11 +615,10 @@ bool PositionCacheEntry::Retrieve(unsigned int styleNumber_, const char *s_, } unsigned int PositionCacheEntry::Hash(unsigned int styleNumber_, const char *s, unsigned int len_) noexcept { - const unsigned char *us = reinterpret_cast<const unsigned char *>(s); - unsigned int ret = us[0] << 7; + unsigned int ret = s[0] << 7; for (unsigned int i=0; i<len_; i++) { ret *= 1000003; - ret ^= us[i]; + ret ^= s[i]; } ret *= 1000003; ret ^= len_; |