Skip to content

Commit

Permalink
Merge pull request #89 from yoshuawuyts/lingering-fixes
Browse files Browse the repository at this point in the history
push fixes from #79
  • Loading branch information
yoshuawuyts authored Nov 16, 2022
2 parents 3be404a + 34b47f2 commit faba0b7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/stream/merge/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ where
wakers: WakerList,
state: PollStates,
done: bool,
len: usize,
}

impl<S> Merge<S>
Expand All @@ -42,7 +41,6 @@ where
rng: RandomGenerator::new(),
complete: 0,
done: false,
len,
}
}
}
Expand Down Expand Up @@ -71,8 +69,8 @@ where
// Iterate over our streams one-by-one. If a stream yields a value,
// we exit early. By default we'll return `Poll::Ready(None)`, but
// this changes if we encounter a `Poll::Pending`.
let len = *this.len;
let r = this.rng.generate(this.streams.len() as u32) as usize;
let len = this.streams.len();
let r = this.rng.generate(len as u32) as usize;
for index in (0..len).map(|n| (r + n).wrapping_rem(len)) {
if !readiness.any_ready() {
// Nothing is ready yet
Expand Down

0 comments on commit faba0b7

Please sign in to comment.