mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-27 19:41:50 +02:00
grafts: Preserve the cache across recursive calls.
Before this commit, we'd lose the cache across recursive calls to
'cumulative-grafts', which isn't great performance-wise.
This bug was already present before
d38bc9a9f6.
* guix/grafts.scm (with-cache): In the miss case, call 'current-state'
after EXP has been evaluated.
This commit is contained in:
+2
-1
@@ -221,7 +221,8 @@ available."
|
|||||||
((_ . result) ;cache hit
|
((_ . result) ;cache hit
|
||||||
(return result))
|
(return result))
|
||||||
(#f ;cache miss
|
(#f ;cache miss
|
||||||
(mlet %state-monad ((result (begin exp ...)))
|
(mlet %state-monad ((result (begin exp ...))
|
||||||
|
(cache (current-state)))
|
||||||
(mbegin %state-monad
|
(mbegin %state-monad
|
||||||
(set-current-state (vhash-consq key result cache))
|
(set-current-state (vhash-consq key result cache))
|
||||||
(return result)))))))
|
(return result)))))))
|
||||||
|
|||||||
Reference in New Issue
Block a user