diff options
| author | daurnimator <quae@daurnimator.com> | 2021-01-02 01:10:47 +1100 |
|---|---|---|
| committer | daurnimator <quae@daurnimator.com> | 2021-01-02 01:10:47 +1100 |
| commit | 03e2c53747a7eeb0d162f7b7fa7763fffdeba2d8 (patch) | |
| tree | a4282b2d44fd27ba1a3f4059ee17ba28bfda60b6 /lib/std/packed_int_array.zig | |
| parent | 31ba9d569b14a3e147d9bdfe88d63a1ed134bc5f (diff) | |
| download | zig-03e2c53747a7eeb0d162f7b7fa7763fffdeba2d8.tar.gz zig-03e2c53747a7eeb0d162f7b7fa7763fffdeba2d8.zip | |
Add workaround in PackedIntArray .initAllTo for #7635
Diffstat (limited to 'lib/std/packed_int_array.zig')
| -rw-r--r-- | lib/std/packed_int_array.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/packed_int_array.zig b/lib/std/packed_int_array.zig index c726f17672..c53d6f0505 100644 --- a/lib/std/packed_int_array.zig +++ b/lib/std/packed_int_array.zig @@ -205,7 +205,8 @@ pub fn PackedIntArrayEndian(comptime Int: type, comptime endian: builtin.Endian, ///Initialize all entries of a packed array to the same value pub fn initAllTo(int: Int) Self { - var self = @as(Self, undefined); + // TODO: use `var self = @as(Self, undefined);` https://github.com/ziglang/zig/issues/7635 + var self = Self{ .bytes = [_]u8{0} ** total_bytes }; self.setAll(int); return self; } |
