Ensured, that rng gets only set when it was null

This commit is contained in:
tsommer committed 2020-09-29 20:25:17 +02:00
1 parent 1110a080ac
commit 9b35ce01aa
1 file changed
+1 -1
+1 -1
View File
@@ -171,7 +171,7 @@ namespace FastRng.Double
}
var range = rangeEnd - rangeStart;
distribution.Random = this;
distribution.Random ??= this;
var distributedValue = await distribution.GetDistributedValue(cancel);
return (uint) ((distributedValue * range) + rangeStart);