Commit 92a423739d

Sebastian <15335529+Sobeston@users.noreply.github.com>
2020-04-01 10:11:05
mem.zeroes - add sentinel terminated array support
1 parent a5af78c
Changed files (1)
lib
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,