libexpr: remove unused return types

Change-Id: Ief898b70f9781bd3dbe66734710f388daa2f2fed
This commit is contained in:
eldritch horrors
2025-09-28 00:02:21 +02:00
parent acd85805ab
commit fe6dfa5ace
2 changed files with 7 additions and 17 deletions
+5 -13
View File
@@ -545,18 +545,11 @@ Path EvalPaths::toRealPath(const Path & path, const NixStringContext & context)
: path;
}
Value * EvalBuiltins::addConstant(const std::string & name, const Value & v, Constant info)
void EvalBuiltins::addConstant(const std::string & name, const Value & v2, Constant info)
{
Value * v2 = mem.allocValue();
*v2 = v;
addConstant(name, v2, info);
return v2;
}
Value * v = mem.allocValue();
*v = v2;
void EvalBuiltins::addConstant(const std::string & name, Value * v, Constant info)
{
auto name2 = name.substr(0, 2) == "__" ? name.substr(2) : name;
constantInfos.push_back({name2, info});
@@ -582,7 +575,7 @@ std::ostream & operator<<(std::ostream & output, const PrimOp & primOp)
return output;
}
Value * EvalBuiltins::addPrimOp(PrimOpDetails && primOp)
void EvalBuiltins::addPrimOp(PrimOpDetails && primOp)
{
/* Hack to make constants lazy: turn them into a application of
the primop to a dummy value. */
@@ -591,7 +584,7 @@ Value * EvalBuiltins::addPrimOp(PrimOpDetails && primOp)
auto vPrimOp = mem.allocValue();
vPrimOp->mkPrimOp(new PrimOp(std::move(primOp)));
Value v{NewValueAs::app, mem, *vPrimOp, *vPrimOp};
return addConstant(
addConstant(
vPrimOp->primOp()->name,
v,
{
@@ -610,7 +603,6 @@ Value * EvalBuiltins::addPrimOp(PrimOpDetails && primOp)
staticEnv->vars.insert_or_assign(auto(envName), baseEnvDispl);
env.values[baseEnvDispl++] = v;
env.values[0]->attrs()->push_back(Attr(symbols.create(v->primOp()->name), v));
return v;
}
+2 -4
View File
@@ -265,11 +265,9 @@ private:
void createBaseEnv(const SearchPath & searchPath, const Path & storeDir);
Value * addConstant(const std::string & name, const Value & v, Constant info);
void addConstant(const std::string & name, const Value & v, Constant info);
void addConstant(const std::string & name, Value * v, Constant info);
Value * addPrimOp(PrimOpDetails && primOp);
void addPrimOp(PrimOpDetails && primOp);
Value prepareNixPath(const SearchPath & searchPath);