about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--third_party/nix/src/libexpr/eval.cc4
-rw-r--r--third_party/nix/src/libexpr/eval.hh3
2 files changed, 3 insertions, 4 deletions
diff --git a/third_party/nix/src/libexpr/eval.cc b/third_party/nix/src/libexpr/eval.cc
index f068b6ba6a..3ecd990daa 100644
--- a/third_party/nix/src/libexpr/eval.cc
+++ b/third_party/nix/src/libexpr/eval.cc
@@ -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);
     }
diff --git a/third_party/nix/src/libexpr/eval.hh b/third_party/nix/src/libexpr/eval.hh
index c244b6eecc..d2ff99c9fc 100644
--- a/third_party/nix/src/libexpr/eval.hh
+++ b/third_party/nix/src/libexpr/eval.hh
@@ -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;