From 6089c59ba0d38fc881e6d829acecade4f28636cb Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 16 Nov 2018 22:45:20 -0800 Subject: [PATCH] Eliminate more string-copy calls. --- src/runtime/http-syntax.scm | 12 +++++------- src/runtime/system.scm | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/runtime/http-syntax.scm b/src/runtime/http-syntax.scm index b6c5ab1c6..46b65cdcb 100644 --- a/src/runtime/http-syntax.scm +++ b/src/runtime/http-syntax.scm @@ -1492,13 +1492,11 @@ USA. (define-deferred default-http-user-agent (list (cons "MIT-GNU-Scheme" - (let ((s (string-copy (get-subsystem-version-string "release")))) - (let ((end (string-length s))) - (do ((i 0 (+ i 1))) - ((not (< i end))) - (if (not (char-in-set? (string-ref s i) char-set:http-token)) - (string-set! s i #\_)))) - s)))) + (string-map (lambda (c) + (if (char-in-set? c char-set:http-token) + c + #\_)) + (get-subsystem-version-string "release"))))) (define (vector->values vector) (apply values (vector->list vector))) diff --git a/src/runtime/system.scm b/src/runtime/system.scm index 6b8d74829..6f44472b3 100644 --- a/src/runtime/system.scm +++ b/src/runtime/system.scm @@ -96,7 +96,7 @@ USA. (s (version-string (cdr entry)))) (and s (if (string-null? s) - (string-copy name) + name (string-append name " " s))))))) (define (version-string version) -- 2.25.1