guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: store: 'references/substitutes' really caches its result.


From: Ludovic Courtès
Subject: 02/02: store: 'references/substitutes' really caches its result.
Date: Sat, 1 Jul 2017 18:42:00 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit b2fde4800d39863d9260509ac0b174b459d42840
Author: Ludovic Courtès <address@hidden>
Date:   Sun Jul 2 00:37:49 2017 +0200

    store: 'references/substitutes' really caches its result.
    
    Until now the cache was always empty because 'for-each' was passed ITEMS
    as its second argument, and ITEMS was the empty list at that point.
    
    * guix/store.scm (references/substitutes): Add 'requested' variable.
    Use it as second argument of 'for-each' in base case.
---
 guix/store.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/guix/store.scm b/guix/store.scm
index afd26d3..a207d47 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -1009,7 +1009,8 @@ error if there is no such root."
 length as ITEMS.  Query substitute information for any item missing from the
 store at once.  Raise a '&nix-protocol-error' exception if reference
 information for one of ITEMS is missing."
-  (let* ((local-refs (map (lambda (item)
+  (let* ((requested  items)
+         (local-refs (map (lambda (item)
                             (or (hash-ref %reference-cache item)
                                 (guard (c ((nix-protocol-error? c) #f))
                                   (references store item))))
@@ -1040,7 +1041,7 @@ the list of references")
         (()
          (let ((result (reverse result)))
            (for-each (cut hash-set! %reference-cache <> <>)
-                     items result)
+                     requested result)
            result))
         ((item items ...)
          (match local-refs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]