mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 14:30:50 -08:00
Faster constant pool string searching
* lisp/emacs-lisp/bytecomp.el (byte-compile-get-constant): No reason not to use 'assoc' to search for strings as well. Previously we kept searching even after having found the string!
This commit is contained in:
parent
305744fdfc
commit
676ee88eea
1 changed files with 2 additions and 8 deletions
|
|
@ -3870,14 +3870,8 @@ assignment (i.e. `setq')."
|
|||
(byte-compile-dynamic-variable-op 'byte-varset var))))
|
||||
|
||||
(defmacro byte-compile-get-constant (const)
|
||||
`(or (if (stringp ,const)
|
||||
;; In a string constant, treat properties as significant.
|
||||
(let (result)
|
||||
(dolist (elt byte-compile-constants)
|
||||
(if (equal-including-properties (car elt) ,const)
|
||||
(setq result elt)))
|
||||
result)
|
||||
(assoc ,const byte-compile-constants #'eql))
|
||||
`(or (assoc ,const byte-compile-constants
|
||||
(if (stringp ,const) #'equal-including-properties #'eql))
|
||||
(car (setq byte-compile-constants
|
||||
(cons (list ,const) byte-compile-constants)))))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue