From 83ff3453dcac00e847a4d23419c6eba1026bd3fb Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Tue, 4 May 2021 15:54:17 -0700 Subject: [PATCH] keeper --- src/string_mutable.zig | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/string_mutable.zig b/src/string_mutable.zig index 7a7964dec9..0ced3011ed 100644 --- a/src/string_mutable.zig +++ b/src/string_mutable.zig @@ -82,12 +82,9 @@ pub const MutableString = struct { try self.list.replaceRange(self.allocator, 0, std.mem.len(str[0..]), str[0..]); } } - pub fn growBy(self: *MutableString, amount: usize) callconv(.Inline) !void { - try self.ensureCapacity(self.list.capacity + amount); - } - pub fn ensureCapacity(self: *MutableString, amount: usize) callconv(.Inline) !void { - try self.list.ensureCapacity(self.allocator, amount); + pub fn growBy(self: *MutableString, amount: usize) callconv(.Inline) !void { + try self.list.ensureUnusedCapacity(self.allocator, amount); } pub fn deinit(self: *MutableString) !void {