Skip to documentation
SLOP

tiny.preserves.valueCompare

Reference tiny.preserves valueCompare

Defined in tiny.preserves.

Returns the order of a against b, the same answer as a.compare(b).

No direct callersNo direct callstiny.preservesvalueCompare
Static calls · unresolved targets: 0 · external targets: 1.

Source

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

zig
/// Returns the order of `a` against `b`, the same answer as `a.compare(b)`. Code that sorts values/// passes this as the comparison, for the package's one total order. Values of different kinds/// order by kind: booleans, doubles, integers, strings, byte strings, symbols, records, sequences,/// sets, dictionaries, embedded values, then the four pattern forms. Doubles order by a total order/// over their bits, so every double, `NaN` included, has one place. Sets and dictionaries compare/// their elements in ascending order under `compare`, whatever their storage order. The call/// allocates nothing. Its cost on two sets grows with the square of their size.pub fn valueCompare(a: AnyValue, b: AnyValue) std.math.Order {    return a.compare(b);}

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

zig
pub const valueCompare = any.valueCompare;

Audit

Definitions1
Public names1
Members0
Version26.7.0
Revisiondaab053ee433