about summary refs log tree commit diff
path: root/third_party
diff options
context:
space:
mode:
Diffstat (limited to 'third_party')
-rw-r--r--third_party/nix/src/libexpr/eval.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/third_party/nix/src/libexpr/eval.cc b/third_party/nix/src/libexpr/eval.cc
index 56e4006204..a834e097a5 100644
--- a/third_party/nix/src/libexpr/eval.cc
+++ b/third_party/nix/src/libexpr/eval.cc
@@ -1667,6 +1667,12 @@ bool EvalState::eqValues(Value& v1, Value& v2) {
       return true;
 
     case tAttrs: {
+      // As an optimisation if both values are pointing towards the
+      // same attribute set, we can skip all this extra work.
+      if (v1.attrs == v2.attrs) {
+        return true;
+      }
+
       /* If both sets denote a derivation (type = "derivation"),
          then compare their outPaths. */
       if (isDerivation(v1) && isDerivation(v2)) {