aboutsummaryrefslogtreecommitdiff
path: root/src/string_mutable.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/string_mutable.zig')
-rw-r--r--src/string_mutable.zig7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/string_mutable.zig b/src/string_mutable.zig
index 7a7964dec..0ced3011e 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 {