libstore: don't ContinueImmediately where we can tail call
there's no reason to go through the event loop in these cases. returning ContinueImmediately here is just a very convoluted way of jumping to the state we've just set after unwinding one frame of the stack, which never matters in the cases changed here because there are no live RAII guards. Change-Id: I7c00948c22e3caf35e934c1a14ffd2d40efc5547
This commit is contained in:
parent
e55ec75619
commit
c2b90d235f
2 changed files with 4 additions and 4 deletions
|
@ -649,7 +649,7 @@ Goal::WorkResult DerivationGoal::inputsRealised(bool inBuildSlot)
|
|||
slot to become available, since we don't need one if there is a
|
||||
build hook. */
|
||||
state = &DerivationGoal::tryToBuild;
|
||||
return ContinueImmediately{};
|
||||
return tryToBuild(inBuildSlot);
|
||||
}
|
||||
|
||||
void DerivationGoal::started()
|
||||
|
@ -772,7 +772,7 @@ Goal::WorkResult DerivationGoal::tryToBuild(bool inBuildSlot)
|
|||
actLock.reset();
|
||||
|
||||
state = &DerivationGoal::tryLocalBuild;
|
||||
return ContinueImmediately{};
|
||||
return tryLocalBuild(inBuildSlot);
|
||||
}
|
||||
|
||||
Goal::WorkResult DerivationGoal::tryLocalBuild(bool inBuildSlot) {
|
||||
|
|
|
@ -188,7 +188,7 @@ Goal::WorkResult PathSubstitutionGoal::referencesValid(bool inBuildSlot)
|
|||
assert(worker.store.isValidPath(i));
|
||||
|
||||
state = &PathSubstitutionGoal::tryToRun;
|
||||
return ContinueImmediately{};
|
||||
return tryToRun(inBuildSlot);
|
||||
}
|
||||
|
||||
|
||||
|
@ -256,7 +256,7 @@ Goal::WorkResult PathSubstitutionGoal::finished(bool inBuildSlot)
|
|||
|
||||
/* Try the next substitute. */
|
||||
state = &PathSubstitutionGoal::tryNext;
|
||||
return ContinueImmediately{};
|
||||
return tryNext(inBuildSlot);
|
||||
}
|
||||
|
||||
worker.markContentsGood(storePath);
|
||||
|
|
Loading…
Reference in a new issue