From 7c0bb29dae201c855c5276a0222740aca530d68c Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 30 May 2000 03:51:59 +0000 Subject: [PATCH] GET-OUTPUT-FROM-ACCUMULATOR should return the internal accumulator string, rather than copying the string to a new one. Since the internal accumulator is discarded, this is not a problem, and offers significant efficiency gains. --- v7/src/runtime/strout.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/v7/src/runtime/strout.scm b/v7/src/runtime/strout.scm index bf140d115..ee20fbca9 100644 --- a/v7/src/runtime/strout.scm +++ b/v7/src/runtime/strout.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: strout.scm,v 14.13 2000/01/04 17:24:00 cph Exp $ +$Id: strout.scm,v 14.14 2000/05/30 03:51:59 cph Exp $ -Copyright (c) 1988-1999 Massachusetts Institute of Technology +Copyright (c) 1988-2000 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -80,12 +80,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (without-interrupts (lambda () (let ((state (port/state port))) - (let ((result - (string-head (accumulator-state-accumulator state) - (accumulator-state-counter state)))) + (let ((s (accumulator-state-accumulator state)) + (n (accumulator-state-counter state))) (set-accumulator-state-accumulator! state (make-string 16)) (set-accumulator-state-counter! state 0) - result))))) + (set-string-maximum-length! s n) + s))))) (define-structure (accumulator-state (type vector)) accumulator -- 2.25.1