]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/byte-opt.el: Optimize how tags are checked for use.
authorVibhav Pant <vibhavp@gmail.com>
Sun, 15 Jan 2017 16:08:31 +0000 (21:38 +0530)
committerVibhav Pant <vibhavp@gmail.com>
Sun, 15 Jan 2017 16:08:31 +0000 (21:38 +0530)
* byte-opt.el: (byte-optimize-lapcode): Return nil instantly on
  finding the tag in a jump table.

lisp/emacs-lisp/byte-opt.el

index 9412ce3b26d1610b462c26b537e9dcaa5c8a5397..c774d26c04b5410e5c995beb761b41a1ebe37a95 100644 (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)