File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -1109,17 +1109,14 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
11091109 else = > {},
11101110 },
11111111 .array = > | arr | {
1112- // Retrieve fixed-size array as slice then copy it
1112+ // Retrieve fixed-size array as slice
11131113 const slice_type = []arr .child ;
11141114 const slice_value = try self .jsValueToZig (named_function , slice_type , js_value );
11151115 if (slice_value .len != arr .len ) {
11161116 // Exact length match, we could allow smaller arrays, but we would not be able to communicate how many were written
11171117 return error .InvalidArgument ;
11181118 }
1119-
1120- var result : T = undefined ;
1121- @memcpy (& result , slice_value [0.. arr .len ]);
1122- return result ;
1119+ return @as (* T , @ptrCast (slice_value .ptr )).* ;
11231120 },
11241121 .@"struct" = > {
11251122 return try (self .jsValueToStruct (named_function , T , js_value )) orelse {
You can’t perform that action at this time.
0 commit comments