Skip to content

Commit

Permalink
remove std.ArrayList.removeOrError function
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Jul 16, 2018
1 parent d3ce9d0 commit 9b56efc
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions std/array_list.zig
Expand Up @@ -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);
Expand Down

0 comments on commit 9b56efc

Please sign in to comment.