Skip to content
Snippets Groups Projects
Commit f529361c authored by ram's avatar ram
Browse files

In NEW-CACHE-ATTRIBUTE, moved the error check earlier so that we do it

before we bogue out with a type error.
parent 1b55f5ea
No related branches found
No related tags found
No related merge requests found
...@@ -164,12 +164,12 @@ ...@@ -164,12 +164,12 @@
;;; ;;;
(defun new-cache-attribute (attribute function) (defun new-cache-attribute (attribute function)
(let* ((hash (hash-it attribute function)) (let* ((hash (hash-it attribute function))
(values (gethash attribute *character-attributes*)) (values (or (gethash attribute *character-attributes*)
(error "~S is not a defined character attribute."
attribute)))
(bucket (svref *character-attribute-cache* hash)) (bucket (svref *character-attribute-cache* hash))
(bit (nthcdr (- character-attribute-bucket-size 2) bucket)) (bit (nthcdr (- character-attribute-bucket-size 2) bucket))
(end-wins (funcall function (attribute-descriptor-end-value values)))) (end-wins (funcall function (attribute-descriptor-end-value values))))
(unless values
(error "~S is not a defined character attribute." attribute))
(shiftf bit (cdr bit) nil) (shiftf bit (cdr bit) nil)
(setf (svref *character-attribute-cache* hash) bit (setf (svref *character-attribute-cache* hash) bit
(cdr bit) bucket bit (car bit)) (cdr bit) bucket bit (car bit))
......
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