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) {
|
for (auto & name : selector) {
|
||||||
nrLookups++;
|
nrLookups++;
|
||||||
Bindings::iterator j;
|
Bindings::iterator j;
|
||||||
forceValue(*vAttrs, pos);
|
|
||||||
if (vAttrs->type() != nAttrs ||
|
if (vAttrs->type() != nAttrs ||
|
||||||
(j = vAttrs->attrs->find(name)) == vAttrs->attrs->end()) {
|
(j = vAttrs->attrs->find(name)) == vAttrs->attrs->end()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
vAttrs = j->value;
|
vAttrs = j->value;
|
||||||
pos2 = j->pos;
|
pos2 = j->pos;
|
||||||
|
forceValue(*vAttrs, pos2 != NULL ? *pos2 : pos );
|
||||||
if (countCalls && pos2) attrSelects[*pos2]++;
|
if (countCalls && pos2) attrSelects[*pos2]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
forceValue(*vAttrs, ( pos2 != NULL ? *pos2 : pos ) );
|
|
||||||
|
|
||||||
} catch (Error & e) {
|
} catch (Error & e) {
|
||||||
if (pos2 && pos2->file != sDerivationNix) {
|
if (pos2 && pos2->file != sDerivationNix) {
|
||||||
vector<string> strSelector;
|
vector<string> strSelector;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue