Skip to content

Commit

Permalink
reuse outdated children
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Oct 10, 2024
1 parent 25c13eb commit 675e213
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ pub enum ConnectChildOperation {
impl ConnectChildOperation {
pub fn run(parent_task_id: TaskId, child_task_id: TaskId, mut ctx: ExecuteContext<'_>) {
let mut parent_task = ctx.task(parent_task_id, TaskDataCategory::All);
parent_task.remove(&CachedDataItemKey::OutdatedChild {
task: child_task_id,
});
// Quick skip if the child was already connected before
if parent_task
.remove(&CachedDataItemKey::OutdatedChild {
task: child_task_id,
})
.is_some()
{
return;
}
if parent_task.add(CachedDataItem::Child {
task: child_task_id,
value: (),
Expand Down

0 comments on commit 675e213

Please sign in to comment.