DoxigAlpha

getEntryForExisting

Get an entry for a Node that currently exists in the treap. It is undefined behavior if the Node is not currently inserted in the treap. The Entry act's as a slot in the treap to insert/replace/remove the node associated with the key.

Function parameters

Parameters

#
self:*Self
node:*Node

Functions in this namespace

Functions

#

Source

Implementation

#
pub fn getEntryForExisting(self: *Self, node: *Node) Entry {
    assert(node.priority != 0);

    return Entry{
        .key = node.key,
        .treap = self,
        .node = node,
        .context = .{ .inserted_under = node.parent },
    };
}