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:
parent
d28d1a57bf
commit
a8fe0f42f3
1 changed files with 4 additions and 3 deletions
|
@ -492,9 +492,10 @@ interpret its input and output."
|
||||||
(let ((buf (port-read-buffer port)))
|
(let ((buf (port-read-buffer port)))
|
||||||
(set-port-buffer-cur! buf (+ (port-buffer-cur buf) len))
|
(set-port-buffer-cur! buf (+ (port-buffer-cur buf) len))
|
||||||
(if (eq? char the-eof-object)
|
(if (eq? char the-eof-object)
|
||||||
(set-port-buffer-has-eof?! buf #f)
|
(begin
|
||||||
(update-position! char))
|
(set-port-buffer-has-eof?! buf #f)
|
||||||
char))))
|
char)
|
||||||
|
(update-position! char))))))
|
||||||
(define (fast-path buf bv cur buffered)
|
(define (fast-path buf bv cur buffered)
|
||||||
(let ((u8 (bytevector-u8-ref bv cur))
|
(let ((u8 (bytevector-u8-ref bv cur))
|
||||||
(enc (%port-encoding port)))
|
(enc (%port-encoding port)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue