aboutsummaryrefslogtreecommitdiff
path: root/lib/std/array_list.zig
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/array_list.zig')
-rw-r--r--lib/std/array_list.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/std/array_list.zig b/lib/std/array_list.zig
index aecbc73bfe..e064b38566 100644
--- a/lib/std/array_list.zig
+++ b/lib/std/array_list.zig
@@ -263,6 +263,7 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {
if (better_capacity >= new_capacity) break;
}
+ // TODO This can be optimized to avoid needlessly copying undefined memory.
const new_memory = try self.allocator.reallocAtLeast(self.allocatedSlice(), better_capacity);
self.items.ptr = new_memory.ptr;
self.capacity = new_memory.len;