1
0
mirror of https://github.com/facebook/zstd.git synced 2025-08-08 17:22:10 +03:00

Fix minor potential narrowing bug

This commit is contained in:
Nick Terrell
2016-09-06 20:27:11 -07:00
parent 823bf3d08d
commit 4d4d1ad3b3

View File

@@ -221,7 +221,7 @@ static size_t calculateStep(
std::uintmax_t size, std::uintmax_t size,
size_t numThreads, size_t numThreads,
const ZSTD_parameters &params) { const ZSTD_parameters &params) {
size_t step = 1ul << (params.cParams.windowLog + 2); size_t step = size_t{1} << (params.cParams.windowLog + 2);
// If file size is known, see if a smaller step will spread work more evenly // If file size is known, see if a smaller step will spread work more evenly
if (size != 0) { if (size != 0) {
const std::uintmax_t newStep = size / std::uintmax_t{numThreads}; const std::uintmax_t newStep = size / std::uintmax_t{numThreads};