From b9fd30b49e0e38026b36c4db10c9fbd53292e9ed Mon Sep 17 00:00:00 2001 From: Pauan Date: Mon, 24 Jun 2019 18:48:34 +0200 Subject: [PATCH] Adding in TODO note --- crates/js-sys/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/js-sys/src/lib.rs b/crates/js-sys/src/lib.rs index d5b49fcf..f53774fe 100644 --- a/crates/js-sys/src/lib.rs +++ b/crates/js-sys/src/lib.rs @@ -4596,6 +4596,8 @@ macro_rules! arrays { // TODO if this was written in JS it could avoid passing the `view` TypedArray to Rust, // which would be more efficient + // TODO measure if it's faster to use `slice` instead of `new` + // This is safe because the `new` function makes a copy if its argument is a TypedArray unsafe { $name::new(&$name::view(slice)) } }