Skip to content

Commit

Permalink
reshuffle WakerList initialization a little
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshuawuyts committed Nov 15, 2022
1 parent 85c4432 commit b6da9e2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/utils/wakers/waker_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ impl WakerList {
/// Create a new instance of `WakerList`.
pub(crate) fn new(len: usize) -> Self {
let readiness = Arc::new(Mutex::new(Readiness::new(len)));
Self {
wakers: (0..len)
.map(|i| Arc::new(InlineWaker::new(i, readiness.clone())).into())
.collect(),
readiness,
}
let wakers = (0..len)
.map(|i| Arc::new(InlineWaker::new(i, readiness.clone())).into())
.collect();
Self { wakers, readiness }
}

pub(crate) fn get(&self, index: usize) -> Option<&Waker> {
Expand Down

0 comments on commit b6da9e2

Please sign in to comment.