make a small optimization
This commit is contained in:
parent
365ccc7a51
commit
f1b6109b2f
|
@ -30,7 +30,11 @@
|
||||||
(let ((v (promise-value p)))
|
(let ((v (promise-value p)))
|
||||||
(case (promise-state p)
|
(case (promise-state p)
|
||||||
((cached) v)
|
((cached) v)
|
||||||
((chained) (force v))
|
((chained) (let ()
|
||||||
|
(when (eq? 'cached (promise-state v))
|
||||||
|
(set-promise-state! p 'cached)
|
||||||
|
(set-promise-value! p (promise-value v)))
|
||||||
|
(force v)))
|
||||||
((pending) (let ((q (v)))
|
((pending) (let ((q (v)))
|
||||||
(when (eq? 'pending (promise-state p))
|
(when (eq? 'pending (promise-state p))
|
||||||
(set-promise-state! p 'chained)
|
(set-promise-state! p 'chained)
|
||||||
|
|
Loading…
Reference in New Issue