[slime-cvs] CVS update: slime/swank.lisp

Helmut Eller heller at common-lisp.net
Mon Nov 1 17:16:02 UTC 2004


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv6472

Modified Files:
	swank.lisp 
Log Message:
(assign-index): Avoid linear search.
Date: Mon Nov  1 18:16:00 2004
Author: heller

Index: slime/swank.lisp
diff -u slime/swank.lisp:1.257 slime/swank.lisp:1.258
--- slime/swank.lisp:1.257	Fri Oct 29 00:16:01 2004
+++ slime/swank.lisp	Mon Nov  1 18:15:55 2004
@@ -3076,8 +3076,8 @@
              (label-value-line "Precision" (float-precision f))))))
 
 (defvar *inspectee*)
-(defvar *inspectee-parts* (make-array 10 :adjustable t :fill-pointer 0))
-(defvar *inspectee-actions* (make-array 10 :adjustable t :fill-pointer 0))
+(defvar *inspectee-parts*) 
+(defvar *inspectee-actions*)
 (defvar *inspector-stack* '())
 (defvar *inspector-history* (make-array 10 :adjustable t :fill-pointer 0))
 (declaim (type vector *inspector-history*))
@@ -3117,9 +3117,9 @@
                    (action-part-for-emacs label lambda)))))))
 
 (defun assign-index (object vector)
-  (or (position object vector)
-      (progn (vector-push-extend object vector)
-             (position object vector))))
+  (let ((index (fill-pointer vector)))
+    (vector-push-extend object vector)
+    index))
 
 (defun value-part-for-emacs (object string)
   (list :value 





More information about the slime-cvs mailing list