Copy immutable vector more efficiently.

Thanks to @mflatt for the suggestion.
This commit is contained in:
Sam Tobin-Hochstadt 2015-12-06 10:31:01 -05:00
parent e814d742a7
commit b8d4248053

View File

@ -179,9 +179,9 @@
(apply raise-blame-error blame #:missing-party neg-party val args))
(check val raise-blame #f)
(if (and (immutable? val) (not (chaperone? val)))
(apply vector-immutable
(for/list ([e (in-vector val)])
(elem-pos-proj e neg-party)))
(vector->immutable-vector
(for/vector #:length (vector-length val) ([e (in-vector val)])
(elem-pos-proj e neg-party)))
(chaperone-or-impersonate-vector
val
(checked-ref neg-party)