mirror of
https://github.com/facebook/zstd.git
synced 2024-12-01 14:27:40 +08:00
Fix minor potential narrowing bug
This commit is contained in:
parent
823bf3d08d
commit
4d4d1ad3b3
@ -221,7 +221,7 @@ static size_t calculateStep(
|
||||
std::uintmax_t size,
|
||||
size_t numThreads,
|
||||
const ZSTD_parameters ¶ms) {
|
||||
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 (size != 0) {
|
||||
const std::uintmax_t newStep = size / std::uintmax_t{numThreads};
|
||||
|
Loading…
Reference in New Issue
Block a user