| author | |
| committer | |
| log | ef419dd72d3fc9ec1454099367bd8d43f1b5037b |
| tree | 8b49cf7b47cc3cd527cfa0454ae0d27d8582b62f |
| parent | 3be720a729e20720a033f2cf1958311a0112d1f4 |
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-6057214611 files changed, 1 insertions(+), 5 deletions(-)
lib/std/mem.zig+1-5| ... | @@ -341,11 +341,7 @@ pub fn zeroes(comptime T: type) T { | ... | @@ -341,11 +341,7 @@ pub fn zeroes(comptime T: type) T { |
| 341 | } | 341 | } |
| 342 | }, | 342 | }, |
| 343 | .Array => |info| { | 343 | .Array => |info| { |
| 344 | var array: T = undefined; | 344 | return [_]info.child{zeroes(info.child)} ** info.len; |
| 345 | for (array) |*element| { | ||
| 346 | element.* = zeroes(info.child); | ||
| 347 | } | ||
| 348 | return array; | ||
| 349 | }, | 345 | }, |
| 350 | .Vector, | 346 | .Vector, |
| 351 | .ErrorUnion, | 347 | .ErrorUnion, |