[slime-cvs] CVS slime/contrib

CVS User trittweiler trittweiler at common-lisp.net
Mon Nov 23 09:56:02 UTC 2009


Update of /project/slime/cvsroot/slime/contrib
In directory cl-net:/tmp/cvs-serv19339/contrib

Modified Files:
	ChangeLog swank-asdf.lisp 
Log Message:
	* swank-asdf.lisp (system-contains-file-p): Previous definition
	didn't properly propagate positive return value of recursive
	call. Fix that.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2009/11/22 13:03:10	1.282
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2009/11/23 09:56:02	1.283
@@ -1,3 +1,9 @@
+2009-11-23  Tobias C. Rittweiler  <tcr at freebits.de>
+
+	* swank-asdf.lisp (system-contains-file-p): Previous definition
+	didn't properly propagate positive return value of recursive
+	call. Fix that.
+
 2009-11-22  Stas Boukarev  <stassats at gmail.com>
 
 	* slime-repl.el (slime-repl-history-remove-duplicates): New variable,
--- /project/slime/cvsroot/slime/contrib/swank-asdf.lisp	2009/11/21 16:27:55	1.13
+++ /project/slime/cvsroot/slime/contrib/swank-asdf.lisp	2009/11/23 09:56:02	1.14
@@ -93,19 +93,21 @@
    (cl:truename
     (asdf:system-definition-pathname (asdf:find-system name)))))
 
-;;; This looks a little bit ugly, but it needs to be fast because
-;;; there can be many systems with many files
 (defun system-contains-file-p (module pathname pathname-name)
-  (dolist (component (asdf:module-components module))
-    (typecase component
-      (asdf:cl-source-file
-       (when (and (equal pathname-name
-                         (pathname-name
-                          (asdf:component-relative-pathname component)))
-                  (equal pathname (asdf:component-pathname component)))
-         (return t)))
-      (asdf:module
-       (system-contains-file-p component pathname pathname-name)))))
+  (some #'(lambda (component)
+	    (typecase component
+	      (asdf:cl-source-file 
+	       ;; We first compare the relative names because
+	       ;; retrieving the full pathname is somewhat costy; this
+	       ;; function is called a lot, and its performance
+	       ;; translates directly into response time to the user.
+	       (and (equal pathname-name
+			   (pathname-name
+			    (asdf:component-relative-pathname component)))
+		    (equal pathname (asdf:component-pathname component))))
+	      (asdf:module 
+	       (system-contains-file-p component pathname pathname-name))))
+	(asdf:module-components module)))
 
 (defslimefun asdf-determine-system (file buffer-package-name)
   ;; First try to grovel through all defined systems to find a system





More information about the slime-cvs mailing list