diff --git a/source/coral/list.zig b/source/coral/list.zig index 6cdcba2..b4ef085 100755 --- a/source/coral/list.zig +++ b/source/coral/list.zig @@ -144,7 +144,7 @@ pub fn Stack(comptime Value: type) type { const new_length = self.values.len + values.len; if (new_length >= self.capacity) { - try self.grow(allocator, math.min(new_length, self.capacity)); + try self.grow(allocator, values.len + values.len); } const offset_index = self.values.len; @@ -170,7 +170,7 @@ pub fn Stack(comptime Value: type) type { const new_length = self.values.len + amount; if (new_length >= self.capacity) { - try self.grow(allocator, math.max(usize, new_length, self.capacity)); + try self.grow(allocator, amount + amount); } const offset_index = self.values.len;