Skip to content

Commit

Permalink
libraries/prompter/prompter: Simplify next-ready-p.
Browse files Browse the repository at this point in the history
  • Loading branch information
aadcg committed Oct 31, 2022
1 parent 9529794 commit 44a8b67
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions libraries/prompter/prompter.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -436,19 +436,18 @@ This is unblocked when the PROMPTER is `destroy'ed."
(if (= (length (ready-sources sync-queue))
(length (sources prompter)))
t
(progn
(calispel:fair-alt
((calispel:? (ready-channel sync-queue) next-source)
(cond
((null next-source)
nil)
(t
(push next-source (ready-sources sync-queue))
;; Update selection when update is done
(select-first prompter)
next-source)))
((calispel:? (sync-interrupt-channel sync-queue))
nil))))
(calispel:fair-alt
((calispel:? (ready-channel sync-queue) next-source)
(cond
((null next-source)
nil)
(t
(push next-source (ready-sources sync-queue))
;; Update selection when update is done:
(select-first prompter)
next-source)))
((calispel:? (sync-interrupt-channel sync-queue))
nil)))
;; No sync-queue if no input was ever set.
t)))

Expand Down

0 comments on commit 44a8b67

Please sign in to comment.