EvalState::callPathFilter(): Remove unnecessary pathArg argument

This commit is contained in:
Eelco Dolstra 2024-11-20 16:35:47 +01:00
parent a7e1f2d5a3
commit ad7ad017ea
2 changed files with 2 additions and 4 deletions

View File

@ -819,7 +819,6 @@ public:
bool callPathFilter( bool callPathFilter(
Value * filterFun, Value * filterFun,
const SourcePath & path, const SourcePath & path,
std::string_view pathArg,
PosIdx pos); PosIdx pos);
DocComment getDocCommentForPos(PosIdx pos); DocComment getDocCommentForPos(PosIdx pos);

View File

@ -2438,7 +2438,6 @@ static RegisterPrimOp primop_toFile({
bool EvalState::callPathFilter( bool EvalState::callPathFilter(
Value * filterFun, Value * filterFun,
const SourcePath & path, const SourcePath & path,
std::string_view pathArg,
PosIdx pos) PosIdx pos)
{ {
auto st = path.lstat(); auto st = path.lstat();
@ -2446,7 +2445,7 @@ bool EvalState::callPathFilter(
/* Call the filter function. The first argument is the path, the /* Call the filter function. The first argument is the path, the
second is a string indicating the type of the file. */ second is a string indicating the type of the file. */
Value arg1; Value arg1;
arg1.mkString(pathArg); arg1.mkString(path.path.abs());
// assert that type is not "unknown" // assert that type is not "unknown"
Value * args []{&arg1, fileTypeToString(*this, st.type)}; Value * args []{&arg1, fileTypeToString(*this, st.type)};
@ -2489,7 +2488,7 @@ static void addPath(
if (filterFun) if (filterFun)
filter = std::make_unique<PathFilter>([&](const Path & p) { filter = std::make_unique<PathFilter>([&](const Path & p) {
auto p2 = CanonPath(p); auto p2 = CanonPath(p);
return state.callPathFilter(filterFun, {path.accessor, p2}, p2.abs(), pos); return state.callPathFilter(filterFun, {path.accessor, p2}, pos);
}); });
std::optional<StorePath> expectedStorePath; std::optional<StorePath> expectedStorePath;