From a8fe0f42f3483e79ac633d2e7451ad186d5a3b79 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 10 May 2016 16:30:50 +0200 Subject: [PATCH] %read-char speedup * module/ice-9/ports.scm (%read-char): Always call update-position! with the same continuation, so that it will contify. --- module/ice-9/ports.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/ice-9/ports.scm b/module/ice-9/ports.scm index 43283e7e4..27a57089b 100644 --- a/module/ice-9/ports.scm +++ b/module/ice-9/ports.scm @@ -492,9 +492,10 @@ interpret its input and output." (let ((buf (port-read-buffer port))) (set-port-buffer-cur! buf (+ (port-buffer-cur buf) len)) (if (eq? char the-eof-object) - (set-port-buffer-has-eof?! buf #f) - (update-position! char)) - char)))) + (begin + (set-port-buffer-has-eof?! buf #f) + char) + (update-position! char)))))) (define (fast-path buf bv cur buffered) (let ((u8 (bytevector-u8-ref bv cur)) (enc (%port-encoding port)))