2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-02-06 04:35:32 +00:00

Merge pull request #568 from stjepang/fix-random

Fix rng use in Stream::merge
This commit is contained in:
Yoshua Wuyts 2019-11-20 14:08:16 +01:00 committed by GitHub
commit 6f19165e0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,7 +44,7 @@ where
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
let this = self.project();
if utils::random(1) == 1 {
if utils::random(2) == 0 {
poll_next_in_order(this.left, this.right, cx)
} else {
poll_next_in_order(this.right, this.left, cx)