Skip to content

Commit 38ac61b

Browse files
committed
restore shard_idx optimization
1 parent 0639e26 commit 38ac61b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • turbopack/crates/turbo-tasks-backend/src/backend

turbopack/crates/turbo-tasks-backend/src/backend/storage.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ impl Storage {
244244
}
245245

246246
Some(SnapshotShard {
247+
shard_idx,
247248
modified,
248249
storage: self,
249250
process,
@@ -544,6 +545,7 @@ impl Drop for SnapshotGuard<'_> {
544545
}
545546

546547
pub struct SnapshotShard<'l, P> {
548+
shard_idx: usize,
547549
modified: Vec<TaskId>,
548550
storage: &'l Storage,
549551
process: &'l P,
@@ -616,10 +618,9 @@ where
616618
// If any _during_snapshot flags are set, promote them to modified so
617619
// the next snapshot cycle picks them up. end_snapshot won't see this
618620
// task because we removed its entry from snapshots above.
619-
self.shard.storage.promote_during_snapshot_flags(
620-
&mut inner,
621-
self.shard.storage.shard_index(&task_id),
622-
);
621+
self.shard
622+
.storage
623+
.promote_during_snapshot_flags(&mut inner, self.shard.shard_idx);
623624
return Some(item);
624625
}
625626
None

0 commit comments

Comments
 (0)