Skip to content

Commit 7635fa2

Browse files
danmarCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 7e34983 commit 7635fa2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/errorlogger.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ void ErrorMessage::calculateWarningHash(const std::list<const Token*>& callstack
300300

301301
// hash algorithm: sdbm
302302
// any hash algorithm can be used but it has to be the same hash on different platforms and compilers
303-
hash = std::accumulate(hashString.cbegin(), hashString.cend(), 0, [](std::size_t hash, char c) {
304-
return static_cast<unsigned char>(c) + (hash << 6) + (hash << 16) - hash;
303+
hash = std::accumulate(hashString.cbegin(), hashString.cend(), std::size_t{0}, [](std::size_t h, unsigned char c) {
304+
return static_cast<std::size_t>(c) + (h << 6) + (h << 16) - h;
305305
});
306306
}
307307

0 commit comments

Comments
 (0)