From 92a423739d91bd0677940fc1a86b593649cafaa6 Mon Sep 17 00:00:00 2001 From: Sebastian <15335529+Sobeston@users.noreply.github.com> Date: Wed, 1 Apr 2020 09:11:05 +0100 Subject: [PATCH] mem.zeroes - add sentinel terminated array support --- lib/std/mem.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/std/mem.zig b/lib/std/mem.zig index f54eb03d65..cedb1bc27d 100644 --- a/lib/std/mem.zig +++ b/lib/std/mem.zig @@ -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,