seq: remove bogus check-type's

We assume, that *our* make-vector will return vector of correct
length, no need to revalidate that. Also these checks are bogus and
never could have worked, because type specifiers were malformed.

Preserving the checks would require making coerce-to-vector a macro,
which expands typespecifier. Fixes #400.
This commit is contained in:
Daniel Kochmanski 2017-08-16 22:05:35 +02:00
parent 2e4de64023
commit baaab01841

View file

@ -230,17 +230,12 @@ default value of INITIAL-ELEMENT depends on TYPE."
(eq (array-element-type object) elt-type))
(let* ((final-length (if (eq length '*) (length object) length)))
(setf output (make-vector elt-type final-length nil nil nil 0))
(unless (eq length '*)
(check-type output `(vector ,elt-type (,length)) "coerced object"))
(do ((i (make-seq-iterator object) (seq-iterator-next output i))
(j 0 (truly-the index (1+ j))))
((= j final-length)
(setf object output))
(declare (index j))
(setf (aref output j) (seq-iterator-ref object i)))))
(unless (eq length '*)
(unless (= length (length output))
(check-type output `(vector ,elt-type (,length)) "coerced object")))
output))
(defun concatenate (result-type &rest sequences)