[gsharp-cvs] CVS update: gsharp/Flexichain/flexichain.lisp gsharp/Flexichain/flexicursor.lisp

Robert Strandh rstrandh at common-lisp.net
Sun Aug 22 05:01:06 UTC 2004


Update of /project/gsharp/cvsroot/gsharp/Flexichain
In directory common-lisp.net:/tmp/cvs-serv8545

Modified Files:
	flexichain.lisp flexicursor.lisp 
Log Message:
Fixed a bug where cursors were not deleted from the skiplist before
the were moved, which resulted in multiple entries of a cursor in 
the skiplist.

Fixed a test in flexichain the purpose of which was to determine
whether to hop or to move was wrong, resulting in too many objects
being moved in some cases. 

Date: Sat Aug 21 22:01:03 2004
Author: rstrandh

Index: gsharp/Flexichain/flexichain.lisp
diff -u gsharp/Flexichain/flexichain.lisp:1.3 gsharp/Flexichain/flexichain.lisp:1.4
--- gsharp/Flexichain/flexichain.lisp:1.3	Thu Aug 19 06:58:54 2004
+++ gsharp/Flexichain/flexichain.lisp	Sat Aug 21 22:01:02 2004
@@ -331,7 +331,7 @@
 on the right of the buffer."
   (with-slots (buffer gap-start gap-end) chain
     (let ((buffer-size (length buffer)))
-      (cond ((< (- gap-start hot-spot) (- buffer-size gap-start))
+      (cond ((< (- gap-start hot-spot) hot-spot)
              (push-elements-right chain (- gap-start hot-spot)))
             ((<= hot-spot (- buffer-size gap-start))
              (hop-elements-right chain hot-spot))


Index: gsharp/Flexichain/flexicursor.lisp
diff -u gsharp/Flexichain/flexicursor.lisp:1.4 gsharp/Flexichain/flexicursor.lisp:1.5
--- gsharp/Flexichain/flexicursor.lisp:1.4	Thu Aug 19 06:58:54 2004
+++ gsharp/Flexichain/flexicursor.lisp	Sat Aug 21 22:01:02 2004
@@ -201,7 +201,7 @@
 	     (with-slots (cursors) (chain cursor)
 		(with-slots (index) cursor
 		   (setf (skiplist-find cursors index)
-			 (delete index (skiplist-find cursors index)
+			 (delete cursor (skiplist-find cursors index)
 				 :key #'wp-value :test #'eq))
 		   (setf (cursor-pos cursor) (+ cursor-pos n))
 		   (push (make-wp cursor) (skiplist-find cursors index))))))))
@@ -215,7 +215,7 @@
 	     (with-slots (cursors) (chain cursor)
 		(with-slots (index) cursor
 		   (setf (skiplist-find cursors index)
-			 (delete index (skiplist-find cursors index)
+			 (delete cursor (skiplist-find cursors index)
 				 :key #'wp-value :test #'eq))
 		   (setf (cursor-pos cursor) (- cursor-pos n))
 		   (push (make-wp cursor) (skiplist-find cursors index))))))))





More information about the Gsharp-cvs mailing list