mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
std.BoundedArray: add clear()
This commit is contained in:
parent
9c3324173d
commit
7f2466e65f
@ -72,6 +72,11 @@ pub fn BoundedArrayAligned(
|
|||||||
self.len = @intCast(len);
|
self.len = @intCast(len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Remove all elements from the slice.
|
||||||
|
pub fn clear(self: *Self) void {
|
||||||
|
self.len = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/// Copy the content of an existing slice.
|
/// Copy the content of an existing slice.
|
||||||
pub fn fromSlice(m: []const T) error{Overflow}!Self {
|
pub fn fromSlice(m: []const T) error{Overflow}!Self {
|
||||||
var list = try init(m.len);
|
var list = try init(m.len);
|
||||||
|
@ -2264,7 +2264,7 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) !void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
zcu.analysis_roots.resize(0) catch unreachable;
|
zcu.analysis_roots.clear();
|
||||||
|
|
||||||
try comp.queueJob(.{ .analyze_mod = std_mod });
|
try comp.queueJob(.{ .analyze_mod = std_mod });
|
||||||
zcu.analysis_roots.appendAssumeCapacity(std_mod);
|
zcu.analysis_roots.appendAssumeCapacity(std_mod);
|
||||||
|
Loading…
Reference in New Issue
Block a user