Date: Wednesday, January 26, 2011 @ 19:49:32 Author: rtoy Path: /project/cmucl/cvsroot/src/code
Modified: reader.lisp
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.
-------------+ reader.lisp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
Index: src/code/reader.lisp diff -u src/code/reader.lisp:1.67 src/code/reader.lisp:1.68 --- src/code/reader.lisp:1.67 Tue Apr 20 13:57:45 2010 +++ src/code/reader.lisp Wed Jan 26 19:49:32 2011 @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /project/cmucl/cvsroot/src/code/reader.lisp,v 1.67 2010-04-20 17:57:45 rtoy Rel $") + "$Header: /project/cmucl/cvsroot/src/code/reader.lisp,v 1.68 2011-01-27 00:49:32 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -275,8 +275,14 @@ (setf (elt (the simple-vector (character-macro-table rt)) code) (coerce newvalue 'function)) - (setf (gethash code (character-macro-hash-table rt)) - (coerce newvalue 'function))))) + (let ((f (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) (unless *read-suppress*