Commit ec25f492 authored by inge's avatar inge

read-list-enter-read-info is now iterative

parent 592f04c6
......@@ -32,8 +32,6 @@ r\"{a}ttas, f\"{o}rhoppningsvis f\"{o}re sommaren 1991.
* N{r man skickat in en text s} borde den v{nta tills det {r klart
innan den accepterar andra kommandon.
* read-list-enter-read-info skall vara iterativ, inte rekursiv.
* Lappar p} d|rrar f|r m|ten.
* kom-who bufferten avg|r sin bredd genom att titta p} bredden i den
......
Wed Jan 22 00:22:02 1992 Inge Wallin (inge at lysator)
* clienttypes.el (read-list-enter-read-info): Rewritten it into an
iterative function instead of a recursive one.
Mon Jan 13 21:35:29 1992 Per Cederqvist (ceder at robin)
* commands1.el (lyskom-comment-recipients): Catch quits via a
......
......@@ -264,17 +264,33 @@ Args: READ-INFO RLIST &optional BEFORE.
A new item with the same priority as an item that is alreay on the list
will nomally be inserted after the old one, but if BEFORE is non-nil it
will be inserted before it."
(cond
((null rlist)
(cons read-info nil))
((or (atom (car rlist)) ;The dummy element.
(<= (read-info->priority read-info)
(+ (if before -1 0)
(read-info->priority (car rlist)))))
(setcdr rlist (read-list-enter-read-info read-info (cdr rlist) before))
rlist)
(t
(cons read-info rlist))))
(let ((pri (+ (if before 0 -1)
(read-info->priority read-info)))
(continue t))
(while continue
(cond
((null (cdr rlist))
(setcdr rlist (list read-info))
(setq continue nil))
((>= pri (read-info->priority (car (cdr rlist))))
(setcdr rlist (cons read-info (cdr rlist)))
(setq continue nil))
(t
(setq rlist (cdr rlist)))))))
;; This is the old recursive version. It can be removed once it is
;; established that the iterative version is correct. /Inge
;; (cond
;; ((null rlist)
;; (cons read-info nil))
;; ((or (atom (car rlist)) ;The dummy element.
;; (<= (read-info->priority read-info)
;; (+ (if before -1 0)
;; (read-info->priority (car rlist)))))
;; (setcdr rlist (read-list-enter-read-info read-info (cdr rlist) before))
;; rlist)
;; (t
;; (cons read-info rlist))))
(defun read-list-delete-read-info (conf-no rlist)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment