mirror of
https://github.com/NixOS/nix
synced 2025-06-28 01:11:15 +02:00
Make most calls to determinePos() lazy
This commit is contained in:
parent
4c755c3b3f
commit
bd383d1b6f
10 changed files with 46 additions and 24 deletions
|
@ -172,7 +172,7 @@ StringSet DrvInfo::queryMetaNames()
|
|||
|
||||
bool DrvInfo::checkMeta(Value & v)
|
||||
{
|
||||
state->forceValue(v, v.determinePos(noPos));
|
||||
state->forceValue(v, [&]() { return v.determinePos(noPos); });
|
||||
if (v.type() == nList) {
|
||||
for (auto elem : v.listItems())
|
||||
if (!checkMeta(*elem)) return false;
|
||||
|
@ -278,7 +278,7 @@ static bool getDerivation(EvalState & state, Value & v,
|
|||
bool ignoreAssertionFailures)
|
||||
{
|
||||
try {
|
||||
state.forceValue(v, v.determinePos(noPos));
|
||||
state.forceValue(v, [&]() { return v.determinePos(noPos); });
|
||||
if (!state.isDerivation(v)) return true;
|
||||
|
||||
/* Remove spurious duplicates (e.g., a set like `rec { x =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue