From: Nikodemus Siivola Date: Thu, 19 Jul 2007 18:49:44 +0000 (+0000) Subject: 1.0.7.33: better handling of ASSOC and MEMBER on empty lists X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=0d442aff281993a2b2e24d0c7a5c2547b50a5b2e;p=sbcl.git 1.0.7.33: better handling of ASSOC and MEMBER on empty lists * If the second argument is a constant NIL, remove the whole call in the transform and just return NIL. --- diff --git a/src/compiler/seqtran.lisp b/src/compiler/seqtran.lisp index 2ddcdbc..b687c92 100644 --- a/src/compiler/seqtran.lisp +++ b/src/compiler/seqtran.lisp @@ -335,10 +335,16 @@ (if (eq 'key fun) key-form `(%coerce-callable-to-fun ,fun)))) - (if (and (constant-lvar-p list) (policy node (>= speed space))) - `(let ,(mapcar (lambda (fun) `(,fun ,(ensure-fun fun))) funs) - ,(open-code (lvar-value list))) - `(,out-of-line item list ,@(mapcar #'ensure-fun funs))))))) + (let* ((cp (constant-lvar-p list)) + (c-list (when cp (lvar-value list)))) + (cond ((and cp c-list (policy node (>= speed space))) + `(let ,(mapcar (lambda (fun) `(,fun ,(ensure-fun fun))) funs) + ,(open-code c-list))) + ((and cp (not c-list)) + ;; constant nil list -- nothing to find! + nil) + (t + `(,out-of-line item list ,@(mapcar #'ensure-fun funs))))))))) (deftransform member ((item list &key key test test-not) * * :node node) (transform-list-item-seek 'member list key test test-not node)) diff --git a/version.lisp-expr b/version.lisp-expr index a888f19..880cba6 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.7.32" +"1.0.7.33"