Array and Table Literal Expressions for Kym #11

Merged
kayomn merged 7 commits from array-table-literal-expressions into main 2023-06-03 16:18:22 +02:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 5e52fcc795 - Show all commits

View File

@ -144,7 +144,7 @@ pub fn Stack(comptime Value: type) type {
const new_length = self.values.len + values.len; const new_length = self.values.len + values.len;
if (new_length >= self.capacity) { 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; const offset_index = self.values.len;
@ -170,7 +170,7 @@ pub fn Stack(comptime Value: type) type {
const new_length = self.values.len + amount; const new_length = self.values.len + amount;
if (new_length >= self.capacity) { 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; const offset_index = self.values.len;