Skip to content
Snippets Groups Projects
Commit eabcbe14 authored by rtoy's avatar rtoy
Browse files

Micro optimization: In SET-CMT-ENTRY, if the char-code is above

attribute-table-limit and if the newvalue is #'read-token, we don't
actually add the entry to the character-macro-hash-table, because that
is the default value for the hash-table.  This helps to keep the
hash-table size small.
parent 897f4d95
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/reader.lisp,v 1.67 2010/04/20 17:57:45 rtoy Rel $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/reader.lisp,v 1.68 2011/01/27 00:49:32 rtoy Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -275,8 +275,14 @@ ...@@ -275,8 +275,14 @@
(setf (elt (the simple-vector (character-macro-table rt)) (setf (elt (the simple-vector (character-macro-table rt))
code) code)
(coerce newvalue 'function)) (coerce newvalue 'function))
(setf (gethash code (character-macro-hash-table rt)) (let ((f (coerce newvalue 'function)))
(coerce newvalue 'function))))) ;; Don't add an entry if the function would be the same as
;; the default. This needs to be coordinated with
;; GET-CMT-ENTRY above.
(if (eq f #'read-token)
f
(setf (gethash code (character-macro-hash-table rt))
f))))))
(defun undefined-macro-char (stream char) (defun undefined-macro-char (stream char)
(unless *read-suppress* (unless *read-suppress*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment