1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +02:00

%read-char speedup

* module/ice-9/ports.scm (%read-char): Always call update-position! with
  the same continuation, so that it will contify.
This commit is contained in:
Andy Wingo 2016-05-10 16:30:50 +02:00
parent d28d1a57bf
commit a8fe0f42f3

View file

@ -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)))