Commit c75e4c70 authored by Tobias Koppers's avatar Tobias Koppers Committed by Jiachi Liu

Turbopack: use batch add to add initial followers (#85624)

### What?

use batch add to convert children to followers
parent f4ca7950
...@@ -31,8 +31,8 @@ use crate::{ ...@@ -31,8 +31,8 @@ use crate::{
storage::{count, get, get_many, iter_many, remove, update, update_count}, storage::{count, get, get_many, iter_many, remove, update, update_count},
}, },
data::{ data::{
ActivenessState, AggregationNumber, CachedDataItem, CachedDataItemKey, CollectibleRef, ActivenessState, AggregationNumber, CachedDataItem, CachedDataItemKey, CachedDataItemType,
DirtyContainerCount, CollectibleRef, DirtyContainerCount,
}, },
utils::swap_retain, utils::swap_retain,
}; };
...@@ -2295,12 +2295,12 @@ impl AggregationUpdateQueue { ...@@ -2295,12 +2295,12 @@ impl AggregationUpdateQueue {
// When converted from leaf to aggregating node, all children become // When converted from leaf to aggregating node, all children become
// followers // followers
let children: Vec<_> = get_many!(task, Child { task } => task); let children: Vec<_> = get_many!(task, Child { task } => task);
for child_id in children { task.extend_new(
task.add_new(CachedDataItem::Follower { CachedDataItemType::Follower,
task: child_id, children
value: 1, .iter()
}); .map(|&task| CachedDataItem::Follower { task, value: 1 }),
} );
} }
if is_aggregating_node(aggregation_number) { if is_aggregating_node(aggregation_number) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment