From 79bba37c431d97ac042eb887e8a88896a3fff639 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Tue, 12 Nov 2024 10:17:27 +0100 Subject: [PATCH] propagate all collectibles --- .../backend/operation/aggregation_update.rs | 2 +- .../src/backend/operation/cleanup_old_edges.rs | 13 ++----------- .../backend/operation/update_collectible.rs | 18 ++++++------------ 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/turbopack/crates/turbo-tasks-backend/src/backend/operation/aggregation_update.rs b/turbopack/crates/turbo-tasks-backend/src/backend/operation/aggregation_update.rs index 5d8a085910813..3b1795c0ee78c 100644 --- a/turbopack/crates/turbo-tasks-backend/src/backend/operation/aggregation_update.rs +++ b/turbopack/crates/turbo-tasks-backend/src/backend/operation/aggregation_update.rs @@ -146,7 +146,7 @@ impl AggregatedDataUpdate { let aggregation = get_aggregation_number(task); let mut dirty_container_count = Default::default(); let mut collectibles_update: Vec<_> = - get_many!(task, Collectible { collectible } count if *count > 0 => (*collectible, 1)); + get_many!(task, Collectible { collectible } count => (*collectible, *count)); if is_aggregating_node(aggregation) { dirty_container_count = get!(task, AggregatedDirtyContainerCount) .cloned() diff --git a/turbopack/crates/turbo-tasks-backend/src/backend/operation/cleanup_old_edges.rs b/turbopack/crates/turbo-tasks-backend/src/backend/operation/cleanup_old_edges.rs index 5023d89003ec1..9dcdaa499c9ad 100644 --- a/turbopack/crates/turbo-tasks-backend/src/backend/operation/cleanup_old_edges.rs +++ b/turbopack/crates/turbo-tasks-backend/src/backend/operation/cleanup_old_edges.rs @@ -109,23 +109,14 @@ impl Operation for CleanupOldEdgesOperation { }); let mut task = ctx.task(task_id, TaskDataCategory::All); for (collectible, count) in collectibles.iter_mut() { - if update_count!( + update_count!( task, Collectible { collectible: *collectible }, *count - ) { - if *count > 0 { - *count = 1; - } else { - *count = -1; - } - } else { - *count = 0; - } + ); } - collectibles.retain(|(_, count)| *count != 0); queue.extend(AggregationUpdateJob::data_update( &mut task, AggregatedDataUpdate::new().collectibles_update(collectibles), diff --git a/turbopack/crates/turbo-tasks-backend/src/backend/operation/update_collectible.rs b/turbopack/crates/turbo-tasks-backend/src/backend/operation/update_collectible.rs index 597cd98d64507..71843ed1a4c41 100644 --- a/turbopack/crates/turbo-tasks-backend/src/backend/operation/update_collectible.rs +++ b/turbopack/crates/turbo-tasks-backend/src/backend/operation/update_collectible.rs @@ -43,18 +43,12 @@ impl UpdateCollectibleOperation { // Not reduced from outdated } } - if count != 0 && update_count!(task, Collectible { collectible }, count) { - if count > 0 { - queue.extend(AggregationUpdateJob::data_update( - &mut task, - AggregatedDataUpdate::new().collectibles_update(vec![(collectible, 1)]), - )); - } else { - queue.extend(AggregationUpdateJob::data_update( - &mut task, - AggregatedDataUpdate::new().collectibles_update(vec![(collectible, -1)]), - )); - } + if count != 0 { + update_count!(task, Collectible { collectible }, count); + queue.extend(AggregationUpdateJob::data_update( + &mut task, + AggregatedDataUpdate::new().collectibles_update(vec![(collectible, count)]), + )); } drop(task);