mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-13 22:12:31 +03:00
Optimise TestProbability()
This commit is contained in:
parent
a047c5fd0a
commit
08ca375b7f
1 changed files with 2 additions and 4 deletions
|
@ -122,13 +122,11 @@ namespace TEN::Math::Random
|
|||
|
||||
bool TestProbability(float prob)
|
||||
{
|
||||
prob = std::clamp(prob, 0.0f, 1.0f);
|
||||
|
||||
if (prob == 0.0f)
|
||||
if (prob <= 0.0f)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (prob == 1.0f)
|
||||
else if (prob >= 1.0f)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue