mirror of
https://github.com/ziglang/zig.git
synced 2026-02-15 22:09:49 +00:00
mem.zeroes - add sentinel terminated array support
This commit is contained in:
parent
a5af78c376
commit
92a423739d
@ -341,6 +341,9 @@ pub fn zeroes(comptime T: type) T {
|
||||
}
|
||||
},
|
||||
.Array => |info| {
|
||||
if (info.sentinel) |sentinel| {
|
||||
return [_:info.sentinel]info.child{zeroes(info.child)} ** info.len;
|
||||
}
|
||||
return [_]info.child{zeroes(info.child)} ** info.len;
|
||||
},
|
||||
.Vector,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user