mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 20:39:05 +00:00
Reduce over-allocation
This commit is contained in:
@@ -393,7 +393,7 @@ pub fn MultiArrayList(comptime S: type) type {
|
||||
pub fn clone(self: Self, gpa: Allocator) !Self {
|
||||
var result = Self{};
|
||||
errdefer result.deinit(gpa);
|
||||
try result.ensureTotalCapacity(gpa, self.len);
|
||||
try result.setCapacity(gpa, self.len);
|
||||
result.len = self.len;
|
||||
const self_slice = self.slice();
|
||||
const result_slice = result.slice();
|
||||
|
||||
Reference in New Issue
Block a user