Skip to content

Commit fbf7131

Browse files
committed
reuse outdated children
1 parent 959e9e3 commit fbf7131

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

turbopack/crates/turbo-tasks-backend/src/backend/operation/connect_child.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,15 @@ pub enum ConnectChildOperation {
3131
impl ConnectChildOperation {
3232
pub fn run(parent_task_id: TaskId, child_task_id: TaskId, mut ctx: ExecuteContext<'_>) {
3333
let mut parent_task = ctx.task(parent_task_id, TaskDataCategory::All);
34-
parent_task.remove(&CachedDataItemKey::OutdatedChild {
35-
task: child_task_id,
36-
});
34+
// Quick skip if the child was already connected before
35+
if parent_task
36+
.remove(&CachedDataItemKey::OutdatedChild {
37+
task: child_task_id,
38+
})
39+
.is_some()
40+
{
41+
return;
42+
}
3743
if parent_task.add(CachedDataItem::Child {
3844
task: child_task_id,
3945
value: (),

0 commit comments

Comments
 (0)