chore(3p/nix): don't optional-wrap EvalState::file_access_trace_fn further
std::function has a natural null we can't eliminate anyway, so this was effectively std::optional<std::optional<non_nullable_function>>. Change-Id: If99f139146021edb25d133dad7f0f6e125ef53df Reviewed-on: https://cl.tvl.fyi/c/depot/+/1688 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: glittershark <grfn@gws.fyi>
This commit is contained in:
parent
7db734afad
commit
3049f31d28
2 changed files with 3 additions and 4 deletions
4
third_party/nix/src/libexpr/eval.cc
vendored
4
third_party/nix/src/libexpr/eval.cc
vendored
|
@ -1821,9 +1821,9 @@ void EvalState::printStats() {
|
|||
}
|
||||
|
||||
void EvalState::TraceFileAccess(const Path& realPath) {
|
||||
if (file_access_trace_fn.has_value()) {
|
||||
if (file_access_trace_fn) {
|
||||
if (last_traced_file != realPath) {
|
||||
(*file_access_trace_fn)(realPath);
|
||||
file_access_trace_fn(realPath);
|
||||
// Basic deduplication.
|
||||
last_traced_file = std::string(realPath);
|
||||
}
|
||||
|
|
3
third_party/nix/src/libexpr/eval.hh
vendored
3
third_party/nix/src/libexpr/eval.hh
vendored
|
@ -303,8 +303,7 @@ class EvalState : public gc {
|
|||
|
||||
bool countCalls;
|
||||
|
||||
std::optional<std::function<void(const Path&)>> file_access_trace_fn =
|
||||
std::nullopt;
|
||||
std::function<void(const Path&)> file_access_trace_fn = nullptr;
|
||||
Path last_traced_file = "";
|
||||
|
||||
typedef std::map<Symbol, size_t> PrimOpCalls;
|
||||
|
|
Loading…
Reference in a new issue