diff options
| author | daurnimator <quae@daurnimator.com> | 2020-02-07 14:17:40 +1100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-03-06 18:49:10 -0500 |
| commit | 119ac13eda7fe95b6c1139b4bd20e05928abe427 (patch) | |
| tree | 854e48803baff1397abab4e8b8fba91f374c0cc6 /lib/std/buffer.zig | |
| parent | fa46bcb36864e6616ce4449965063f3b8720f8e1 (diff) | |
| download | zig-119ac13eda7fe95b6c1139b4bd20e05928abe427.tar.gz zig-119ac13eda7fe95b6c1139b4bd20e05928abe427.zip | |
std: add .startsWith and .endsWith to std.ArrayList
Diffstat (limited to 'lib/std/buffer.zig')
| -rw-r--r-- | lib/std/buffer.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/buffer.zig b/lib/std/buffer.zig index f808af1485..bcefe5bdfb 100644 --- a/lib/std/buffer.zig +++ b/lib/std/buffer.zig @@ -133,7 +133,7 @@ pub const Buffer = struct { pub fn startsWith(self: Buffer, m: []const u8) bool { if (self.len() < m.len) return false; - return mem.eql(u8, self.list.items[0..m.len], m); + return self.list.startsWith(m); } pub fn endsWith(self: Buffer, m: []const u8) bool { |
