DoxigAlpha

removeOrNull

Pop the highest priority element from the queue. Returns null if empty.

Function parameters

Parameters

#
self:*Self

Priority queue for storing generic data.

Functions

#
PriorityQueue
Priority queue for storing generic data.

Source

Implementation

#
pub fn removeOrNull(self: *Self) ?T {
    return if (self.items.len > 0) self.remove() else null;
}