* lisp/emacs-lisp/byte-opt.el: Optimize how tags are checked for use.

* byte-opt.el: (byte-optimize-lapcode): Return nil instantly on
  finding the tag in a jump table.
This commit is contained in:
Vibhav Pant 2017-01-15 21:38:31 +05:30
parent 8c0f326ea2
commit 309b46420e

View file

@ -1730,10 +1730,9 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance."
;;
((and (eq 'TAG (car lap0))
(not (rassq lap0 lap))
(= (length (cl-loop for table in byte-compile-jump-tables
when (member lap0 (hash-table-values table))
collect t))
0))
(cl-loop for table in byte-compile-jump-tables
when (member lap0 (hash-table-values table))
return nil finally return t))
(and (memq byte-optimize-log '(t byte))
(byte-compile-log " unused tag %d removed" (nth 1 lap0)))
(setq lap (delq lap0 lap)