X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fseq.lisp;h=ea6fda7f384ddb5befcca3739750fb4a0efdb3f9;hb=fe6da9f355488152649de48885b96205043c0f82;hp=32d6c8d81a11ea95dc1aa7c63126442169736ea1;hpb=892a8350afb02baabef38c4cba48c25a82d9d679;p=sbcl.git diff --git a/src/code/seq.lisp b/src/code/seq.lisp index 32d6c8d..ea6fda7 100644 --- a/src/code/seq.lisp +++ b/src/code/seq.lisp @@ -301,16 +301,17 @@ (typecase expanded-type (atom (cond ((eq expanded-type 'string) '(vector character)) - ((eq expanded-type 'simple-string) '(simple-array character (*))) + ((eq expanded-type 'simple-string) + '(simple-array character (*))) (t type))) (cons (cond - ((eq (car expanded-type) 'string) `(vector character ,@(cdr expanded-type))) + ((eq (car expanded-type) 'string) + `(vector character ,@(cdr expanded-type))) ((eq (car expanded-type) 'simple-string) `(simple-array character ,(if (cdr expanded-type) (cdr expanded-type) '(*)))) - (t type))) - (t type))) + (t type))))) (type (specifier-type adjusted-type))) (cond ((csubtypep type (specifier-type 'list)) (cond @@ -781,7 +782,7 @@ many elements are copied." (let ((,sequence ,s)) (seq-dispatch ,sequence (dolist (,e ,sequence ,return) ,@body) - (dovector (,e ,sequence ,return) ,@body) + (do-vector-data (,e ,sequence ,return) ,@body) (multiple-value-bind (state limit from-end step endp elt) (sb!sequence:make-sequence-iterator ,sequence) (do ((state state (funcall step ,sequence state from-end))) @@ -1070,24 +1071,13 @@ many elements are copied." (type list sequences)) (let ((index start)) (declare (type index index)) - (if (and sequences (null (rest sequences))) - ;; do it manually when there is 1 input sequence - (with-array-data ((src (first sequences)) (src-start) (src-end) - :check-fill-pointer t) - (let ((src-index src-start)) - (declare (type index src-index)) - (loop until (or (eql src-index src-end) - (eql index end)) - do (setf (aref data index) (funcall fun (aref src src-index))) - (incf index) - (incf src-index)))) - (block mapping - (map-into-lambda sequences (&rest args) - (declare (truly-dynamic-extent args)) - (when (eql index end) - (return-from mapping)) - (setf (aref data index) (apply fun args)) - (incf index)))) + (block mapping + (map-into-lambda sequences (&rest args) + (declare (truly-dynamic-extent args)) + (when (eql index end) + (return-from mapping)) + (setf (aref data index) (apply fun args)) + (incf index))) index)) ;;; Uses the machinery of (MAP NIL ...). For non-vectors we avoid @@ -1194,7 +1184,7 @@ many elements are copied." ;; from the old seq.lisp into target-seq.lisp. (define-compiler-macro ,name (pred first-seq &rest more-seqs) (let ((elements (make-gensym-list (1+ (length more-seqs)))) - (blockname (gensym "BLOCK"))) + (blockname (sb!xc:gensym "BLOCK"))) (once-only ((pred pred)) `(block ,blockname (map nil @@ -2246,11 +2236,12 @@ many elements are copied." ((simple-array base-char (*)) (frob2)) ,@(when bit-frob `((simple-bit-vector - (if (and (eq #'identity key) + (if (and (typep item 'bit) + (eq #'identity key) (or (eq #'eq test) (eq #'eql test) (eq #'equal test))) - (let ((p (%bit-position (the bit item) sequence + (let ((p (%bit-position item sequence from-end start end))) (if p (values item p)