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

Use standard random API #1988

Merged
merged 3 commits into from
May 6, 2020
Merged

Use standard random API #1988

merged 3 commits into from
May 6, 2020

Conversation

turansky
Copy link
Contributor

@turansky turansky commented May 3, 2020

  • Deprecated API usage removed

@@ -35,8 +36,7 @@ private fun HTMLElement.setPosition(x: Double, y: Double) {
}
}

@Suppress("DEPRECATION")
private fun random() = kotlin.js.Math.random()
private fun random():Double = Random.nextDouble()
Copy link
Contributor

Choose a reason for hiding this comment

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

One empty line should also be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which one? I don't add empty lines :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry. My bad. Disregard.

Copy link
Contributor

Choose a reason for hiding this comment

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

I somehow thought I've removed the function completely. Actually, there's now no much sense in having this function in the first place -- it would be better if it is just inlined to all its use-sites.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Inlined

@turansky turansky requested a review from elizarov May 6, 2020 11:12
@elizarov elizarov merged commit 18f68ad into Kotlin:develop May 6, 2020
recheej pushed a commit to recheej/kotlinx.coroutines that referenced this pull request Dec 28, 2020
* Use standard random API
* Inline 'random' method
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.

2 participants