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 @@ -1131,17 +1131,14 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
11311131 else = > {},
11321132 },
11331133 .array = > | arr | {
1134- // Retrieve fixed-size array as slice then copy it
1134+ // Retrieve fixed-size array as slice
11351135 const slice_type = []arr .child ;
11361136 const slice_value = try self .jsValueToZig (named_function , slice_type , js_value );
11371137 if (slice_value .len != arr .len ) {
11381138 // Exact length match, we could allow smaller arrays, but we would not be able to communicate how many were written
11391139 return error .InvalidArgument ;
11401140 }
1141-
1142- var result : T = undefined ;
1143- @memcpy (& result , slice_value [0.. arr .len ]);
1144- return result ;
1141+ return @as (* T , @ptrCast (slice_value .ptr )).* ;
11451142 },
11461143 .@"struct" = > {
11471144 return try (self .jsValueToStruct (named_function , T , js_value )) orelse {
You can’t perform that action at this time.
0 commit comments