Commit 472703b5 authored by Luke Sandberg's avatar Luke Sandberg

But what if we are already resolved to the correct value.

parent ede8d1b8
...@@ -209,6 +209,10 @@ impl RawVc { ...@@ -209,6 +209,10 @@ impl RawVc {
} }
async fn resolve_inner(self, mut consistency: ReadConsistency) -> Result<RawVc> { async fn resolve_inner(self, mut consistency: ReadConsistency) -> Result<RawVc> {
// Handle this first to avoid taking a reference to turbo_tasks
if matches!(self, RawVc::TaskCell(_, _)) {
return Ok(self);
}
let tt = turbo_tasks(); let tt = turbo_tasks();
let mut current = self; let mut current = self;
let mut notified = false; let mut notified = false;
...@@ -237,8 +241,12 @@ impl RawVc { ...@@ -237,8 +241,12 @@ impl RawVc {
/// Convert a potentially local `RawVc` into a non-local `RawVc`. This is a subset of resolution /// Convert a potentially local `RawVc` into a non-local `RawVc`. This is a subset of resolution
/// resolution, because the returned `RawVc` can be a `TaskOutput`. /// resolution, because the returned `RawVc` can be a `TaskOutput`.
pub(crate) async fn to_non_local(self) -> Result<RawVc> { pub(crate) async fn to_non_local(self) -> Result<RawVc> {
let tt = turbo_tasks(); // Handle this first to avoid taking a reference to turbo_tasks
if !matches!(self, RawVc::LocalOutput(_, _, _)) {
return Ok(self);
}
let mut current = self; let mut current = self;
let tt = turbo_tasks();
loop { loop {
match current { match current {
RawVc::LocalOutput(execution_id, local_task_id, ..) => { RawVc::LocalOutput(execution_id, local_task_id, ..) => {
......
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