Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2487] Fixed random selection issue #2488

Merged
merged 1 commit into from
May 15, 2022

Conversation

sudeeptarlekar
Copy link
Contributor

Issue#

closes #2487

Description:

Fixed random class issue.

Signed-off-by: sudeeptarlekar <sudeeptarlekar@gmail.com>
Copy link
Member

@connorshea connorshea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised this works on all Ruby versions honestly, but the tests pass so ¯_(ツ)_/¯

@connorshea
Copy link
Member

I tried this locally and can confirm 1) this is an actual problem, and 2) it is resolved by this change.

@Qqwy
Copy link

Qqwy commented May 11, 2023

I'm surprised this works on all Ruby versions honestly, but the tests pass so ¯_(ツ)_/¯

As long as only .rand is used then it will work on all Ruby versions, since Random::rand has been available (delegating to Random::DEFAULT.rand) on old Ruby versions. But the same is not true for .seed. Currently the only place where .seed seems to be used is in the README so this is probably fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change of Random::DEFAULT -> Random.new is incorrect
3 participants