~ chicken-core (chicken-5) 3374287531e72947e1e9a5cda896ae070f55fbec
commit 3374287531e72947e1e9a5cda896ae070f55fbec
Author: Evan Hanson <evhan@foldling.org>
AuthorDate: Mon Dec 28 15:38:02 2020 +1300
Commit: Mario Domenech Goulart <mario@parenteses.org>
CommitDate: Mon Dec 28 10:21:58 2020 +0100
Remove useless peek-char when read-string is called without read length
This call to `peek-char' was introduced by c78cdcd9, but it's useless
and was probably only included in that commit by accident. The
`read-string!/port` helper that's used just below to handle input
already takes care of everything for us, no need to peek as well.
Signed-off-by: Mario Domenech Goulart <mario@parenteses.org>
diff --git a/extras.scm b/extras.scm
index cc679697..8a9f6fed 100644
--- a/extras.scm
+++ b/extras.scm
@@ -165,8 +165,7 @@
(let ([out (open-output-string)]
(buf (make-string read-string-buffer-size)))
(let loop ()
- (let ((c (peek-char p))
- (n (read-string!/port read-string-buffer-size buf p 0)))
+ (let ((n (read-string!/port read-string-buffer-size buf p 0)))
(cond ((eq? n 0)
(get-output-string out))
(else
Trap