s3: bytevectors-concat without apply (arg-count limit)
ober
b90d1890e66378c01b2f53173f770883f8244d20
--- a/protonstorage/s3/drive.ss +++ b/protonstorage/s3/drive.ss @@ -279,7 +279,15 @@ out)) (define (bytevectors-concat bvs) - (apply bytevectors-append bvs)) + (let* ([total (bytevectors-length bvs)] + [out (make-bytevector total 0)]) + (let loop ([xs bvs] [offset 0]) + (unless (null? xs) + (let* ([bv (car xs)] + [len (bytevector-length bv)]) + (bytevector-copy! bv 0 out offset len) + (loop (cdr xs) (+ offset len))))) + out)) (define (read-file-size path) (file-info-size (file-info path)))