diff options
author | Sascha Roloff <sascha.roloff@huawei.com> | 2024-02-22 16:10:02 +0100 |
---|---|---|
committer | Sascha Roloff <sascha.roloff@huawei.com> | 2024-02-26 11:05:26 +0100 |
commit | 8793a8caf89d07e2a470d06b365ee9065e8276f1 (patch) | |
tree | b5ba4cfda42fc80e920c3c900632d9662faa896e /src/buildtool/execution_api/execution_service/file_chunker.cpp | |
parent | fe1e763d095d0b390dbd44a105bfa5ff13d98cb1 (diff) | |
download | justbuild-8793a8caf89d07e2a470d06b365ee9065e8276f1.tar.gz |
Remove upper and lower bounds for FastCDC random-number generation
Diffstat (limited to 'src/buildtool/execution_api/execution_service/file_chunker.cpp')
-rw-r--r-- | src/buildtool/execution_api/execution_service/file_chunker.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/buildtool/execution_api/execution_service/file_chunker.cpp b/src/buildtool/execution_api/execution_service/file_chunker.cpp index 280b79a2..a4332110 100644 --- a/src/buildtool/execution_api/execution_service/file_chunker.cpp +++ b/src/buildtool/execution_api/execution_service/file_chunker.cpp @@ -28,8 +28,6 @@ constexpr std::uint64_t kMaskL{0x0000d90003530000ULL}; // 11 '1' bits // Predefined array of 256 random 64-bit integers, needs to be initialized. constexpr std::uint32_t kRandomTableSize{256}; -constexpr std::uint64_t kLowerBound{0x1000000000000000ULL}; -constexpr std::uint64_t kUpperBound{0xffffffffffffffffULL}; // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) std::array<std::uint64_t, kRandomTableSize> gear_table{}; @@ -37,9 +35,8 @@ std::array<std::uint64_t, kRandomTableSize> gear_table{}; auto FileChunker::Initialize(std::uint32_t seed) noexcept -> void { std::mt19937_64 gen64(seed); - std::uniform_int_distribution<std::uint64_t> dist(kLowerBound, kUpperBound); for (auto& item : gear_table) { - item = dist(gen64); + item = gen64(); } } |