mem.zeroes .Array improvements
Before (when given an array with many elements):
```
zig\std\mem.zig:345:13: error: evaluation exceeded 1000
backwards branches
for (array) |*element| {
^
```
related to https://github.com/ziglang/zig/issues/4847#issuecomment-605721461
1 files changed, 1 insertions(+), 5 deletions(-)
lib
std
lib/std/mem.zig+1-5
| ... | ... | @@ -341,11 +341,7 @@ pub fn zeroes(comptime T: type) T { |
| 341 | 341 | } |
| 342 | 342 | }, |
| 343 | 343 | .Array => |info| { |
| 344 | | var array: T = undefined; |
| 345 | | for (array) |*element| { |
| 346 | | element.* = zeroes(info.child); |
| 347 | | } |
| 348 | | return array; |
| 344 | return [_]info.child{zeroes(info.child)} ** info.len; |
| 349 | 345 | }, |
| 350 | 346 | .Vector, |
| 351 | 347 | .ErrorUnion, |