mirror of
https://github.com/NixOS/nix.git
synced 2025-11-19 16:59:35 +01:00
Simplify the forcing of nested records
This commit is contained in:
parent
7c718646cb
commit
6ec852e7f0
1 changed files with 1 additions and 3 deletions
|
|
@ -1212,18 +1212,16 @@ bool EvalState::getAttrField(Value & attrs, const std::vector<Symbol> & selector
|
|||
for (auto & name : selector) {
|
||||
nrLookups++;
|
||||
Bindings::iterator j;
|
||||
forceValue(*vAttrs, pos);
|
||||
if (vAttrs->type() != nAttrs ||
|
||||
(j = vAttrs->attrs->find(name)) == vAttrs->attrs->end()) {
|
||||
return false;
|
||||
}
|
||||
vAttrs = j->value;
|
||||
pos2 = j->pos;
|
||||
forceValue(*vAttrs, pos2 != NULL ? *pos2 : pos );
|
||||
if (countCalls && pos2) attrSelects[*pos2]++;
|
||||
}
|
||||
|
||||
forceValue(*vAttrs, ( pos2 != NULL ? *pos2 : pos ) );
|
||||
|
||||
} catch (Error & e) {
|
||||
if (pos2 && pos2->file != sDerivationNix) {
|
||||
vector<string> strSelector;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue