mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
remove std.ArrayList.removeOrError function
This commit is contained in:
parent
d3ce9d0643
commit
9b56efc957
@ -113,15 +113,6 @@ pub fn AlignedArrayList(comptime T: type, comptime A: u29) type {
|
||||
return old_item;
|
||||
}
|
||||
|
||||
pub fn removeOrError(self: *Self, n: usize) !T {
|
||||
if (n >= self.len) return error.OutOfBounds;
|
||||
if (self.len - 1 == n) return self.pop();
|
||||
|
||||
var old_item = self.at(n);
|
||||
try self.setOrError(n, self.pop());
|
||||
return old_item;
|
||||
}
|
||||
|
||||
pub fn appendSlice(self: *Self, items: []align(A) const T) !void {
|
||||
try self.ensureCapacity(self.len + items.len);
|
||||
mem.copy(T, self.items[self.len..], items);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user