diff options
author | Neil <nyamatongwe@gmail.com> | 2021-10-12 12:00:48 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-10-12 12:00:48 +1100 |
commit | 40e479ba4f68d442fe0552c2551422e884085cdd (patch) | |
tree | f30b3585f36be4492d29c85f0f1d8a1f1014d1f1 /src/PositionCache.cxx | |
parent | 8c07d7f5b68ccb39469dcde13d6d401c3ebb35b4 (diff) | |
download | scintilla-mirror-40e479ba4f68d442fe0552c2551422e884085cdd.tar.gz |
Feature [feature-requests:#1416] Use range for.
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r-- | src/PositionCache.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index e57cb572a..af1c5065c 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -548,10 +548,8 @@ namespace { constexpr unsigned int KeyFromString(std::string_view charBytes) noexcept { PLATFORM_ASSERT(charBytes.length() <= 4); unsigned int k=0; - for (size_t i=0; i < charBytes.length(); i++) { - k = k * 0x100; - const unsigned char uc = charBytes[i]; - k += uc; + for (const unsigned char uc : charBytes) { + k = k * 0x100 + uc; } return k; } |