Skip to content

Commit d94c659

Browse files
edolstramergify[bot]
authored andcommitted
resolveLookupPathPath(): Fix caching of negative lookups
This avoids spamming in case the missing search path entry does not exist (#12480). (cherry picked from commit df08e1e) # Conflicts: # src/libexpr/eval.cc
1 parent 658392e commit d94c659

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/libexpr/eval.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3084,8 +3084,16 @@ std::optional<std::string> EvalState::resolveLookupPathPath(const LookupPath::Pa
30843084
auto i = lookupPathResolved.find(value);
30853085
if (i != lookupPathResolved.end()) return i->second;
30863086

3087+
<<<<<<< HEAD
30873088
auto finish = [&](std::string res) {
30883089
debug("resolved search path element '%s' to '%s'", value, res);
3090+
=======
3091+
auto finish = [&](std::optional<SourcePath> res) {
3092+
if (res)
3093+
debug("resolved search path element '%s' to '%s'", value, *res);
3094+
else
3095+
debug("failed to resolve search path element '%s'", value);
3096+
>>>>>>> df08e1e20 (resolveLookupPathPath(): Fix caching of negative lookups)
30893097
lookupPathResolved.emplace(value, res);
30903098
return res;
30913099
};
@@ -3137,9 +3145,13 @@ std::optional<std::string> EvalState::resolveLookupPathPath(const LookupPath::Pa
31373145
}
31383146
}
31393147

3148+
<<<<<<< HEAD
31403149
debug("failed to resolve search path element '%s'", value);
31413150
return std::nullopt;
31423151

3152+
=======
3153+
return finish(std::nullopt);
3154+
>>>>>>> df08e1e20 (resolveLookupPathPath(): Fix caching of negative lookups)
31433155
}
31443156

31453157

0 commit comments

Comments
 (0)