mirror of
https://github.com/ziglang/zig.git
synced 2024-11-28 08:02:32 +00:00
std: add ArrayList.eql for parity with std.Buffer
This commit is contained in:
parent
119ac13eda
commit
fd23decbd9
@ -249,6 +249,10 @@ pub fn AlignedArrayList(comptime T: type, comptime alignment: ?u29) type {
|
||||
return self.pop();
|
||||
}
|
||||
|
||||
pub fn eql(self: Self, m: []const T) bool {
|
||||
return mem.eql(T, self.toSliceConst(), m);
|
||||
}
|
||||
|
||||
pub fn startsWith(self: Self, m: []const T) bool {
|
||||
if (self.len < m.len) return false;
|
||||
return mem.eql(T, self.items[0..m.len], m);
|
||||
|
Loading…
Reference in New Issue
Block a user