Skip to content

Commit 5298824

Browse files
committed
Remove a layzer of indirction from cell access
1 parent 6316c4b commit 5298824

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub trait Operation:
3737
+ TryFrom<AnyOperation, Error = ()>
3838
+ Into<AnyOperation>
3939
{
40-
fn execute(self, ctx: &mut impl ExecuteContext);
40+
fn execute(self, ctx: &mut impl ExecuteContext<'_>);
4141
}
4242

4343
#[derive(Copy, Clone)]
@@ -579,7 +579,7 @@ pub enum AnyOperation {
579579
}
580580

581581
impl AnyOperation {
582-
pub fn execute(self, ctx: &mut impl ExecuteContext) {
582+
pub fn execute(self, ctx: &mut impl ExecuteContext<'_>) {
583583
match self {
584584
AnyOperation::ConnectChild(op) => op.execute(ctx),
585585
AnyOperation::Invalidate(op) => op.execute(ctx),

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl UpdateOutputOperation {
4646
pub fn run(
4747
task_id: TaskId,
4848
output: Result<RawVc, TurboTasksExecutionError>,
49-
mut ctx: impl ExecuteContext,
49+
mut ctx: impl ExecuteContext<'_>,
5050
) {
5151
let mut dependent_tasks = Default::default();
5252
let mut children = Default::default();
@@ -140,7 +140,7 @@ impl UpdateOutputOperation {
140140
}
141141

142142
impl Operation for UpdateOutputOperation {
143-
fn execute(mut self, ctx: &mut impl ExecuteContext) {
143+
fn execute(mut self, ctx: &mut impl ExecuteContext<'_>) {
144144
loop {
145145
ctx.operation_suspend_point(&self);
146146
match self {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ enum ModifiedState {
612612
pub struct Storage {
613613
snapshot_mode: AtomicBool,
614614
modified: FxDashMap<TaskId, ModifiedState>,
615-
map: FxDashMap<TaskId, Box<InnerStorage>>,
615+
map: FxDashMap<TaskId, InnerStorage>,
616616
}
617617

618618
impl Storage {
@@ -786,7 +786,7 @@ impl Storage {
786786
pub fn access_mut(&self, key: TaskId) -> StorageWriteGuard<'_> {
787787
let inner = match self.map.entry(key) {
788788
dashmap::mapref::entry::Entry::Occupied(e) => e.into_ref(),
789-
dashmap::mapref::entry::Entry::Vacant(e) => e.insert(Box::new(InnerStorage::new())),
789+
dashmap::mapref::entry::Entry::Vacant(e) => e.insert(InnerStorage::new()),
790790
};
791791
StorageWriteGuard {
792792
storage: self,
@@ -799,7 +799,7 @@ impl Storage {
799799
key1: TaskId,
800800
key2: TaskId,
801801
) -> (StorageWriteGuard<'_>, StorageWriteGuard<'_>) {
802-
let (a, b) = get_multiple_mut(&self.map, key1, key2, || Box::new(InnerStorage::new()));
802+
let (a, b) = get_multiple_mut(&self.map, key1, key2, || InnerStorage::new());
803803
(
804804
StorageWriteGuard {
805805
storage: self,
@@ -820,7 +820,7 @@ impl Storage {
820820

821821
pub struct StorageWriteGuard<'a> {
822822
storage: &'a Storage,
823-
inner: RefMut<'a, TaskId, Box<InnerStorage>>,
823+
inner: RefMut<'a, TaskId, InnerStorage>,
824824
}
825825

826826
impl StorageWriteGuard<'_> {
@@ -873,7 +873,7 @@ impl StorageWriteGuard<'_> {
873873
if !state.any_snapshot() {
874874
self.storage.modified.insert(
875875
*self.inner.key(),
876-
ModifiedState::Snapshot(Some(Box::new((&**self.inner).into()))),
876+
ModifiedState::Snapshot(Some(Box::new((&*self.inner).into()))),
877877
);
878878
}
879879
let state = self.inner.state_mut();

0 commit comments

Comments
 (0)