MCPcopy Create free account
hub / github.com/brimdata/super / NewGeneric

Function NewGeneric

runtime/sam/expr/extent/span.go:40–49  ·  view source on GitHub ↗

Create a new Range from generic range of super.Values according to lower and upper. The range is not sensitive to the absolute order of lower and upper.

(lower, upper super.Value, cmp expr.CompareFn)

Source from the content-addressed store, hash-verified

38// to lower and upper. The range is not sensitive to the absolute order
39// of lower and upper.
40func NewGeneric(lower, upper super.Value, cmp expr.CompareFn) *Generic {
41 if cmp(lower, upper) > 0 {
42 lower, upper = upper, lower
43 }
44 return &Generic{
45 first: lower,
46 last: upper,
47 cmp: cmp,
48 }
49}
50
51func NewGenericFromOrder(first, last super.Value, o order.Which) *Generic {
52 return NewGeneric(first, last, expr.NewValueCompareFn(o, o.NullsMax(true)))

Callers 2

addMethod · 0.92
NewGenericFromOrderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected