From: Chris Hanson Date: Sat, 17 Nov 2018 06:45:20 +0000 (-0800) Subject: Eliminate more string-copy calls. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~60 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=6089c59ba0d38fc881e6d829acecade4f28636cb;p=mit-scheme.git Eliminate more string-copy calls. --- 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)