aboutsummaryrefslogtreecommitdiff
path: root/lib/std/priority_queue.zig
diff options
context:
space:
mode:
authorZander Khan <git@zander.xyz>2021-01-17 14:43:38 +0000
committerZander Khan <git@zander.xyz>2021-01-17 14:43:38 +0000
commit5bfd9238de82b8f66ba4834bcf7aa120e42fe6ca (patch)
treefe1a573d430cc15d8d15ff3a4d04f8adbbe85fa5 /lib/std/priority_queue.zig
parent9a09ebb1b92f33913bdcc16e9d978fb6e5a820f1 (diff)
downloadzig-5bfd9238de82b8f66ba4834bcf7aa120e42fe6ca.tar.gz
zig-5bfd9238de82b8f66ba4834bcf7aa120e42fe6ca.zip
Remove `resize`. Adding uninitialized memory at the end of the `items` would break the heap property.
Diffstat (limited to 'lib/std/priority_queue.zig')
-rw-r--r--lib/std/priority_queue.zig5
1 files changed, 0 insertions, 5 deletions
diff --git a/lib/std/priority_queue.zig b/lib/std/priority_queue.zig
index 844d37580c..f67b390608 100644
--- a/lib/std/priority_queue.zig
+++ b/lib/std/priority_queue.zig
@@ -187,11 +187,6 @@ pub fn PriorityQueue(comptime T: type) type {
self.items = try self.allocator.realloc(self.items, better_capacity);
}
- pub fn resize(self: *Self, new_len: usize) !void {
- try self.ensureCapacity(new_len);
- self.len = new_len;
- }
-
/// Reduce allocated capacity to `new_len`.
pub fn shrinkAndFree(self: *Self, new_len: usize) void {
assert(new_len <= self.items.len);