[slime-cvs] CVS slime/contrib

CVS User alendvai alendvai at common-lisp.net
Fri Oct 15 16:09:07 UTC 2010


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

Modified Files:
	swank-fuzzy.lisp 
Log Message:
Fuzzy completion: speed up by 2-4 times (on sbcl)

--- /project/slime/cvsroot/slime/contrib/swank-fuzzy.lisp	2010/09/04 00:32:14	1.11
+++ /project/slime/cvsroot/slime/contrib/swank-fuzzy.lisp	2010/10/15 16:09:07	1.12
@@ -465,8 +465,9 @@
 
 Once a word has been completely matched, the chunks are pushed
 onto the special variable *ALL-CHUNKS* and the function returns."
-  (declare ;(optimize speed)
-           (fixnum short-index initial-full-index)
+  (declare (optimize speed)
+           (type fixnum short-index initial-full-index)
+           (type list current-chunk)
            (simple-string short full)
            (special *all-chunks*))
   (flet ((short-cur () 
@@ -485,10 +486,13 @@
            "Collects the current chunk to CHUNKS and prepares for
             a new chunk."
            (when current-chunk
-             (push (list current-chunk-pos
-                         (coerce (reverse current-chunk) 'string)) chunks)
-             (setf current-chunk nil
-                   current-chunk-pos nil))))
+             (let ((current-chunk-as-string (nreverse
+                                             (make-array (length current-chunk)
+                                                         :element-type 'character
+                                                         :initial-contents current-chunk))))
+               (push (list current-chunk-pos current-chunk-as-string) chunks)
+               (setf current-chunk nil
+                     current-chunk-pos nil)))))
     ;; If there's an outstanding chunk coming in collect it.  Since
     ;; we're recursively called on skipping an input character, the
     ;; chunk can't possibly continue on.





More information about the slime-cvs mailing list