diff options
author | 2021-05-04 15:54:17 -0700 | |
---|---|---|
committer | 2021-05-04 15:54:17 -0700 | |
commit | d19f939e7dc7e3250d01688647236c16be6a7374 (patch) | |
tree | ca050dc1fce343498e598f9459a0d7d09f78620a /src | |
parent | ea84c6dc3cad821fbaaa60e314c088c422200d34 (diff) | |
download | bun-d19f939e7dc7e3250d01688647236c16be6a7374.tar.gz bun-d19f939e7dc7e3250d01688647236c16be6a7374.tar.zst bun-d19f939e7dc7e3250d01688647236c16be6a7374.zip |
keeper
Former-commit-id: 83ff3453dcac00e847a4d23419c6eba1026bd3fb
Diffstat (limited to 'src')
-rw-r--r-- | src/string_mutable.zig | 7 |
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 { |