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
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(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 @@
	(setf (elt (the simple-vector (character-macro-table rt))
		   code)
	      (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))
	      (coerce newvalue 'function)))))
		    f))))))

(defun undefined-macro-char (stream char)
  (unless *read-suppress*