Commit d2fd8497 authored by Robert Strandh's avatar Robert Strandh
Browse files

Improved performance of loading a file by employing an new addition to

the Flexichain library.  You will have to update your Flexichain
directory from CVS in order for this to work.
parent 0a6985c4
......@@ -327,9 +327,7 @@ at the end of the buffer if no following newline character exists."))
sequence."))
(defmethod insert-buffer-sequence ((buffer standard-buffer) offset sequence)
(loop for elem across sequence
do (insert-buffer-object buffer offset elem)
(incf offset)))
(insert-vector* (slot-value buffer 'contents) offset sequence))
(defgeneric insert-object (mark object)
(:documentation "Insert the object at the mark. This function simply calls
......
......@@ -23,11 +23,14 @@
(in-package :climacs-base)
(defun input-from-stream (stream buffer offset)
(let ((eof-object (cons nil nil)))
(loop for obj = (read-char stream nil eof-object)
until (eq obj eof-object)
do (insert-buffer-object buffer offset obj)
(incf offset))))
(loop with vec = (make-array 10000 :element-type 'character)
for count = (read-sequence vec stream)
while (plusp count)
do (if (= count (length vec))
(insert-buffer-sequence buffer offset vec)
(insert-buffer-sequence buffer offset
(subseq vec 0 count)))
(incf offset count)))
(defun output-to-stream (stream buffer offset1 offset2)
(loop for offset from offset1 below offset2
......
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