pub fn fromOwnedSlice(items: []T, context: Context) Self
PriorityQueue takes ownership of the passed in slice. The slice must have been allocated with allocator. Deinitialize with deinit.
allocator
deinit
items: []T
context: Context
161 162 163 164 165 166 167 168 169 170 171 172 173 174
pub fn fromOwnedSlice(items: []T, context: Context) Self { var self = Self{ .items = items, .cap = items.len, .context = context, }; var i = self.items.len >> 1; while (i > 0) { i -= 1; self.siftDown(i); } return self; }
PriorityQueue takes ownership of the passed in slice. The slice must have been allocated with
allocator. Deinitialize withdeinit.