core:select actions: stop at first match, do not collect all matching actions

This commit is contained in:
Helmut Merz 2024-08-30 16:21:12 +02:00
parent 974937cba7
commit 487279bc1b

View file

@ -31,13 +31,14 @@
acts)) acts))
(defun select (msg acts) (defun select (msg acts)
(let ((h (shape:head msg)) (let ((h (shape:head msg)))
(hdlrs nil)) ;(hdlrs nil))
(dolist (a acts) (dolist (a acts)
(if (match (pattern a) h) (when (match (pattern a) h)
(dolist (hdlr (handlers a)) (return-from select (handlers a))))))
#| (dolist (hdlr (handlers a))
(push hdlr hdlrs)))) (push hdlr hdlrs))))
hdlrs)) hdlrs))|#
;(nreverse hdlrs))) ;(nreverse hdlrs)))
(defun match (pat h) (defun match (pat h)