aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Amado <kamadorueda@gmail.com>2022-01-21 11:44:19 -0500
committerKevin Amado <kamadorueda@gmail.com>2022-01-21 16:32:43 -0500
commit50efc5499a7d924828bed654be207a846c040fa0 (patch)
tree83cd4c17ecce955bb5054d1b0d69d66905781743
parent3d2ad2b70ba26114bfd5ba55d8b580d4f3b158af (diff)
determinePos: remove from critical path
-rw-r--r--src/libexpr/attr-path.cc2
-rw-r--r--src/libexpr/eval-cache.cc4
-rw-r--r--src/libexpr/eval.cc6
3 files changed, 6 insertions, 6 deletions
diff --git a/src/libexpr/attr-path.cc b/src/libexpr/attr-path.cc
index 8ec24269f..42a088050 100644
--- a/src/libexpr/attr-path.cc
+++ b/src/libexpr/attr-path.cc
@@ -58,7 +58,7 @@ std::pair<Value *, Pos> findAlongAttrPath(EvalState & state, const string & attr
Value * vNew = state.allocValue();
state.autoCallFunction(autoArgs, *v, *vNew);
v = vNew;
- state.forceValue(*v, v->determinePos(vIn.determinePos(noPos)));
+ state.forceValue(*v, noPos);
/* It should evaluate to either a set or an expression,
according to what is specified in the attrPath. */
diff --git a/src/libexpr/eval-cache.cc b/src/libexpr/eval-cache.cc
index 222a34116..d6b9ea29b 100644
--- a/src/libexpr/eval-cache.cc
+++ b/src/libexpr/eval-cache.cc
@@ -336,7 +336,7 @@ Value & AttrCursor::getValue()
if (!_value) {
if (parent) {
auto & vParent = parent->first->getValue();
- root->state.forceAttrs(vParent, vParent.determinePos(noPos));
+ root->state.forceAttrs(vParent, noPos);
auto attr = vParent.attrs->get(parent->second);
if (!attr)
throw Error("attribute '%s' is unexpectedly missing", getAttrPathStr());
@@ -381,7 +381,7 @@ Value & AttrCursor::forceValue()
auto & v = getValue();
try {
- root->state.forceValue(v, v.determinePos(noPos));
+ root->state.forceValue(v, noPos);
} catch (EvalError &) {
debug("setting '%s' to failed", getAttrPathStr());
if (root->db)
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index e1c089b95..df411f3d5 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -1280,7 +1280,7 @@ void ExprOpHasAttr::eval(EvalState & state, Env & env, Value & v)
e->eval(state, env, vTmp);
for (auto & i : attrPath) {
- state.forceValue(*vAttrs, vAttrs->determinePos(noPos));
+ state.forceValue(*vAttrs, noPos);
Bindings::iterator j;
Symbol name = getName(i, state, env);
if (vAttrs->type() != nAttrs ||
@@ -2037,8 +2037,8 @@ Path EvalState::coerceToPath(const Pos & pos, Value & v, PathSet & context)
bool EvalState::eqValues(Value & v1, Value & v2)
{
- forceValue(v1, v1.determinePos(noPos));
- forceValue(v2, v2.determinePos(noPos));
+ forceValue(v1, noPos);
+ forceValue(v2, noPos);
/* !!! Hack to support some old broken code that relies on pointer
equality tests between sets. (Specifically, builderDefs calls