Commit a2cc715b authored by yangguo's avatar yangguo Committed by Commit bot

Prevent using 0 as random seed.

R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/1541143002

Cr-Commit-Position: refs/heads/master@{#33008}
parent e10fdbed
......@@ -124,6 +124,7 @@ int RandomNumberGenerator::Next(int bits) {
void RandomNumberGenerator::SetSeed(int64_t seed) {
if (seed == 0) seed = 1;
initial_seed_ = seed;
state0_ = MurmurHash3(bit_cast<uint64_t>(seed));
state1_ = MurmurHash3(state0_);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment