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

Method Call

runtime/sam/expr/function/compare.go:22–41  ·  view source on GitHub ↗
(args []super.Value)

Source from the content-addressed store, hash-verified

20}
21
22func (e *Compare) Call(args []super.Value) super.Value {
23 nullsMax := true
24 if len(args) == 3 {
25 if super.TypeUnder(args[2].Type()) != super.TypeBool {
26 return e.sctx.WrapError("compare: nullsMax arg is not bool", args[2])
27 }
28 nullsMax = args[2].Bool()
29 }
30 if args[0].IsError() {
31 return args[0]
32 }
33 if args[1].IsError() {
34 return args[1]
35 }
36 cmp := e.nullsMax
37 if !nullsMax {
38 cmp = e.nullsMin
39 }
40 return super.NewInt64(int64(cmp(args[0], args[1])))
41}

Callers

nothing calls this directly

Calls 6

TypeUnderFunction · 0.92
NewInt64Function · 0.92
WrapErrorMethod · 0.80
BoolMethod · 0.80
IsErrorMethod · 0.80
TypeMethod · 0.65

Tested by

no test coverage detected