summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2002-07-25 18:18:10 +0000
committerRichard M. Stallman <rms@gnu.org>2002-07-25 18:18:10 +0000
commit1fd592a0b06e5cb42f8e35135fbf384e1fd3d983 (patch)
treeba4d819d6bee018bb5e8c6f2873c8fc3cf8f94c6 /lisp/emacs-lisp
parent94534262c53e8602d72289aca8bef1d0685046a6 (diff)
downloademacs-1fd592a0b06e5cb42f8e35135fbf384e1fd3d983.tar.gz
emacs-1fd592a0b06e5cb42f8e35135fbf384e1fd3d983.tar.bz2
emacs-1fd592a0b06e5cb42f8e35135fbf384e1fd3d983.zip
(byte-compile-set-symbol-position): Don't recompute `entry' on each iteration.
(byte-compile-delete-first): Make it defsubst.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/bytecomp.el24
1 files changed, 11 insertions, 13 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index a8cc1400fdb..936f9fec5cf 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -10,7 +10,7 @@
;;; This version incorporates changes up to version 2.10 of the
;;; Zawinski-Furuseth compiler.
-(defconst byte-compile-version "$Revision: 2.106 $")
+(defconst byte-compile-version "$Revision: 2.107 $")
;; This file is part of GNU Emacs.
@@ -848,7 +848,7 @@ Each function's symbol gets marked with the `byte-compile-noruntime' property."
"Last known character position in the input.")
;; copied from gnus-util.el
-(defun byte-compile-delete-first (elt list)
+(defsubst byte-compile-delete-first (elt list)
(if (eq (car list) elt)
(cdr list)
(let ((total list))
@@ -872,18 +872,16 @@ Each function's symbol gets marked with the `byte-compile-noruntime' property."
;; gross hack? And the answer, of course, would be yes.
(defun byte-compile-set-symbol-position (sym &optional allow-previous)
(when byte-compile-read-position
- (let ((last nil))
+ (let (last entry)
(while (progn
- (setq last byte-compile-last-position)
- (let* ((entry (assq sym read-symbol-positions-list))
- (cur (cdr entry)))
- (setq byte-compile-last-position
- (if cur
- (+ byte-compile-read-position cur)
- last))
- (setq
- read-symbol-positions-list
- (byte-compile-delete-first entry read-symbol-positions-list)))
+ (setq last byte-compile-last-position
+ entry (assq sym read-symbol-positions-list))
+ (when entry
+ (setq byte-compile-last-position
+ (+ byte-compile-read-position (cdr entry))
+ read-symbol-positions-list
+ (byte-compile-delete-first
+ entry read-symbol-positions-list)))
(or (and allow-previous (not (= last byte-compile-last-position)))
(> last byte-compile-last-position)))))))