From ac982d199ac231a1ded2251301fe6d2486bbaa96 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sat, 25 Jun 2011 19:28:48 +0000 Subject: [PATCH] Use %READ-CHAR/%WRITE-CHAR in coding conversions. Elides redundant port checks. --- src/runtime/unicode.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/unicode.scm b/src/runtime/unicode.scm index 8bb849687..b0cd71d59 100644 --- a/src/runtime/unicode.scm +++ b/src/runtime/unicode.scm @@ -258,10 +258,10 @@ USA. (let ((input (open-input string start end)) (output (open-output))) (let loop () - (let ((c (read-char input))) + (let ((c (%read-char input))) (if (not (eof-object? c)) (begin - (write-char c output) + (%write-char c output) (loop))))) (get-output-string! output))) @@ -681,7 +681,7 @@ USA. (define (for-all-chars-in-string? predicate string #!optional start end coding) (let ((port (open-string string start end coding 'FOR-ALL-CHARS-IN-STRING?))) (let loop () - (let ((char (read-char port))) + (let ((char (%read-char port))) (cond ((eof-object? char) #t) ((predicate char) (loop)) (else #f)))))) @@ -689,7 +689,7 @@ USA. (define (for-any-char-in-string? predicate string #!optional start end coding) (let ((port (open-string string start end coding 'FOR-ANY-CHAR-IN-STRING?))) (let loop () - (let ((char (read-char port))) + (let ((char (%read-char port))) (cond ((eof-object? char) #f) ((predicate char) #t) (else (loop))))))) -- 2.25.1