From: Taylor R Campbell Date: Sat, 25 Jun 2011 19:28:48 +0000 (+0000) Subject: Use %READ-CHAR/%WRITE-CHAR in coding conversions. X-Git-Tag: release-9.1.0~3^2~8 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=ac982d199ac231a1ded2251301fe6d2486bbaa96;p=mit-scheme.git Use %READ-CHAR/%WRITE-CHAR in coding conversions. Elides redundant port checks. --- 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)))))))