From: Vibhav Pant Date: Sun, 15 Jan 2017 16:08:31 +0000 (+0530) Subject: * lisp/emacs-lisp/byte-opt.el: Optimize how tags are checked for use. X-Git-Tag: emacs-26.0.90~887 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=309b46420e83826ed1e0b947f98a47e8525e3c36;p=emacs.git * 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. --- diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 9412ce3b26d..c774d26c04b 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -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)