Skip to content

Commit

Permalink
static_cast<int> for QByteArray::size with std::max
Browse files Browse the repository at this point in the history
QByteArray::size returns qsizetype in Qt6, which needs to be
converted to an int to pass to std::max.
  • Loading branch information
Be-ing committed Oct 13, 2021
1 parent 0a94d35 commit 93625fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cache_key_t cacheKeyFromMessageDigest(const QByteArray& messageDigest) {
// 5 Hash function Usage
// 5.1 Truncated Message Digest
const auto significantByteCount = math_min(
messageDigest.size(),
static_cast<int>(messageDigest.size()),
static_cast<int>(sizeof(cache_key_t)));
for (auto i = 0; i < significantByteCount; ++i) {
// Only 8 bits are relevant and we don't want the sign
Expand Down

0 comments on commit 93625fb

Please sign in to comment.