mirror of
https://github.com/ziglang/zig.git
synced 2026-01-28 02:05:31 +00:00
Add workaround in PackedIntArray .initAllTo for #7635
This commit is contained in:
parent
31ba9d569b
commit
03e2c53747
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user