Skip to content

Commit

Permalink
improve readablility
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jan 14, 2025
1 parent d641329 commit 2ee138d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
4 changes: 1 addition & 3 deletions turbopack/crates/turbo-tasks-backend/src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1719,10 +1719,8 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
effective: u32::MAX,
},
});
let mut activeness_state = ActivenessState::new(task_id);
activeness_state.set_root(root_type);
task.add(CachedDataItem::Activeness {
value: activeness_state,
value: ActivenessState::new_root(root_type, task_id),
});
task.add(CachedDataItem::new_scheduled(move || match root_type {
RootType::RootTask => "Root Task".to_string(),
Expand Down
10 changes: 3 additions & 7 deletions turbopack/crates/turbo-tasks-backend/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,9 @@ impl ActivenessState {
}

pub fn new_root(root_ty: RootType, id: TaskId) -> Self {
Self {
root_ty: Some(root_ty),
active_until_clean: false,
all_clean_event: Event::new(move || {
format!("ActivenessState::all_clean_event {:?}", id)
}),
}
let mut this = Self::new(id);
this.set_root(root_ty);
this
}

pub fn set_root(&mut self, root_ty: RootType) {
Expand Down

0 comments on commit 2ee138d

Please sign in to comment.