X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fseqtran.lisp;h=de9f0ff5596b937c05fd5f7c91ec4883f0bd4bff;hb=935d6f6a696c2b0bff1c937cef346cb495e41999;hp=57a9d0f7f57f2ff7841a2635f23457574144902c;hpb=dccd283c6fedf7fe61d2d2bede328a6b7d92f7be;p=sbcl.git diff --git a/src/compiler/seqtran.lisp b/src/compiler/seqtran.lisp index 57a9d0f..de9f0ff 100644 --- a/src/compiler/seqtran.lisp +++ b/src/compiler/seqtran.lisp @@ -203,7 +203,7 @@ 'list) (t (give-up-ir1-transform - "can't determine result type"))))) + "result type unsuitable"))))) (cond ((and result-type-value (null seqs)) ;; The consing arity-1 cases can be implemented ;; reasonably efficiently as function calls, and the cost @@ -972,7 +972,11 @@ ,n-sequence ,start ,n-end))) (block ,block (macrolet ((maybe-return () - '(let ((,element (aref ,sequence ,index))) + ;; WITH-ARRAY-DATA has already performed bounds + ;; checking, so we can safely elide the checks + ;; in the inner loop. + '(let ((,element (locally (declare (optimize (insert-array-bounds-checks 0))) + (aref ,sequence ,index)))) (when ,done-p-expr (return-from ,block (values ,element @@ -1079,7 +1083,8 @@ (macrolet ((define-find-position (fun-name values-index) `(deftransform ,fun-name ((item sequence &key from-end (start 0) end - key test test-not)) + key test test-not) + (t (or list vector) &rest t)) '(nth-value ,values-index (%find-position item sequence from-end start @@ -1093,7 +1098,8 @@ (macrolet ((define-find-position-if (fun-name values-index) `(deftransform ,fun-name ((predicate sequence &key from-end (start 0) - end key)) + end key) + (t (or list vector) &rest t)) '(nth-value ,values-index (%find-position-if (%coerce-callable-to-fun predicate) @@ -1126,7 +1132,8 @@ (macrolet ((define-find-position-if-not (fun-name values-index) `(deftransform ,fun-name ((predicate sequence &key from-end (start 0) - end key)) + end key) + (t (or list vector) &rest t)) '(nth-value ,values-index (%find-position-if-not (%coerce-callable-to-fun predicate)