Skip to documentation
SLOP

tiny.preserves.dictionary

Reference tiny.preserves dictionary

Defined in tiny.preserves.

Makes a dictionary holding a copy of the slice entries, sorted in ascending order of their keys under compare.

No direct callersNo direct callstiny.preservesdictionary
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/preserves/src/any.zig:177

zig
/// Makes a dictionary holding a copy of the slice `entries`, sorted in ascending order of their/// keys under `compare`. Code that builds a dictionary by hand calls it, so repeated keys are/// refused and the storage comes out sorted by key. The duplicate check compares each key with/// every key before it, so its cost grows with the square of the entry count. The copy is one level/// deep: the dictionary shares everything the keys and values point to, and `freeValue` frees/// exactly the slice. The call returns `error.DuplicateDictionaryKey` before it allocates when two/// keys are equal.pub const dictionary = any_constructors.dictionary;

Source: lib/preserves/src/root.zig:199

zig
pub const dictionary = any.dictionary;

Audit

Definitions1
Public names1
Members0
Version26.7.0
Revisiondaab053ee433