Avoid adding an event-handler for message receipt unless there are some body clauses to process

This commit is contained in:
Tony Garnock-Jones 2014-06-27 16:26:05 -04:00
parent d991ad934f
commit 24666b58b3
1 changed files with 7 additions and 6 deletions

View File

@ -410,12 +410,13 @@
#`(if #,condition #,gestalt-name (gestalt-empty))
gestalt-name))
(push! event-handlers
(lambda (e-stx)
#`(match #,e-stx
[(message #,matcher-stx (== #,(or meta-level 0)) #,pub?)
(begin-transition #,@remaining-stx)]
[_ noop-transition]))))
(when (not (stx-null? remaining-stx))
(push! event-handlers
(lambda (e-stx)
#`(match #,e-stx
[(message #,matcher-stx (== #,(or meta-level 0)) #,pub?)
(begin-transition #,@remaining-stx)]
[_ noop-transition])))))
(define (analyze-group-participation! loopspecs-stx pat-stx body-stx pub?)
(define-values (p remaining-stx) (analyze-participator-body body-stx (participator #f #f)))