From: Stas Boukarev Date: Sat, 16 Mar 2013 12:09:03 +0000 (+0400) Subject: Reduce consing for find-package. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=4f24a2734e4c714c0ede097770f9859b8f8c0d5c;p=sbcl.git Reduce consing for find-package. Don't use return-from inside restart-case, it causes consing even when the branch with restart-case is not taken. --- diff --git a/src/code/target-package.lisp b/src/code/target-package.lisp index fd1dffe..7a06e73 100644 --- a/src/code/target-package.lisp +++ b/src/code/target-package.lisp @@ -579,19 +579,18 @@ REMOVE-PACKAGE-LOCAL-NICKNAME, and the DEFPACKAGE option :LOCAL-NICKNAMES." (nicknamed (when nicknames (cdr (assoc string nicknames :test #'string=)))) (packageoid (or nicknamed (gethash string *package-names*)))) - (when (and (null packageoid) - (not *in-package-init*) ; KLUDGE - (let ((mismatch (mismatch "SB!" string))) - (and mismatch (= mismatch 3)))) - (restart-case - (signal 'bootstrap-package-not-found :name string) - (debootstrap-package () - (return-from find-package-using-package + (if (and (null packageoid) + (not *in-package-init*) ; KLUDGE + (let ((mismatch (mismatch "SB!" string))) + (and mismatch (= mismatch 3)))) + (restart-case + (signal 'bootstrap-package-not-found :name string) + (debootstrap-package () (if (string= string "SB!XC") (find-package "COMMON-LISP") (find-package - (substitute #\- #\! string :count 1))))))) - packageoid))) + (substitute #\- #\! string :count 1))))) + packageoid)))) (typecase package-designator (package package-designator) (symbol (find-package-from-string (symbol-name package-designator)))