mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-19 18:20:22 +02:00
Micro-optimize (ice-9 format).
* module/ice-9/format.scm (format): Use `call-with-output-string' instead of `with-output-to-string'.
This commit is contained in:
parent
b908768a7e
commit
6c9220064d
1 changed files with 7 additions and 7 deletions
|
@ -427,15 +427,15 @@
|
||||||
(case modifier
|
(case modifier
|
||||||
((at)
|
((at)
|
||||||
(format:out-str
|
(format:out-str
|
||||||
(with-output-to-string
|
(call-with-output-string
|
||||||
(lambda ()
|
(lambda (p)
|
||||||
(truncated-print (next-arg)
|
(truncated-print (next-arg) p
|
||||||
#:width width)))))
|
#:width width)))))
|
||||||
((colon-at)
|
((colon-at)
|
||||||
(format:out-str
|
(format:out-str
|
||||||
(with-output-to-string
|
(call-with-output-string
|
||||||
(lambda ()
|
(lambda (p)
|
||||||
(truncated-print (next-arg)
|
(truncated-print (next-arg) p
|
||||||
#:width
|
#:width
|
||||||
(max (- width
|
(max (- width
|
||||||
output-col)
|
output-col)
|
||||||
|
@ -779,7 +779,7 @@
|
||||||
(define (format:obj->str obj slashify)
|
(define (format:obj->str obj slashify)
|
||||||
(let ((res (if slashify
|
(let ((res (if slashify
|
||||||
(object->string obj)
|
(object->string obj)
|
||||||
(with-output-to-string (lambda () (display obj))))))
|
(call-with-output-string (lambda (p) (display obj p))))))
|
||||||
(if (and format:read-proof (string-prefix? "#<" res))
|
(if (and format:read-proof (string-prefix? "#<" res))
|
||||||
(object->string res)
|
(object->string res)
|
||||||
res)))
|
res)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue