next.js
7e7301d0 - Take &self in inner run_backend_job instead of &Arc<Self>

Commit
81 days ago
Take &self in inner run_backend_job instead of &Arc<Self> The Backend trait already declares run_backend_job with &self. The inner TurboTasksBackendInner method took self: &'a Arc<Self> only to do let this = self.clone(), but that clone was used purely synchronously within the same loop iteration (snapshot_and_persist / should_evict / evict_after_snapshot, all &self) and never moved into a spawn. The background future's lifetime is anchored by the engine holding the TurboTasks Arc, not by the backend cloning its own inner Arc. Drop the gratuitous clone and take &self.
Author
Parents
Loading