1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

* 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)) ((and (eq 'TAG (car lap0))
(not (rassq lap0 lap)) (not (rassq lap0 lap))
(= (length (cl-loop for table in byte-compile-jump-tables (cl-loop for table in byte-compile-jump-tables
when (member lap0 (hash-table-values table)) when (member lap0 (hash-table-values table))
collect t)) return nil finally return t))
0))
(and (memq byte-optimize-log '(t byte)) (and (memq byte-optimize-log '(t byte))
(byte-compile-log " unused tag %d removed" (nth 1 lap0))) (byte-compile-log " unused tag %d removed" (nth 1 lap0)))
(setq lap (delq lap0 lap) (setq lap (delq lap0 lap)