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

Function BoolValue

vector/bool.go:54–69  ·  view source on GitHub ↗

BoolValue returns the value of slot in vec as a Boolean.

(vec Any, slot uint32)

Source from the content-addressed store, hash-verified

52
53// BoolValue returns the value of slot in vec as a Boolean.
54func BoolValue(vec Any, slot uint32) bool {
55 switch vec := Under(vec).(type) {
56 case *Bool:
57 return vec.Bits.IsSet(slot)
58 case *Const:
59 return BoolValue(vec.Any, 0)
60 case *Dict:
61 return BoolValue(vec.Any, uint32(vec.Index[slot]))
62 case *Dynamic:
63 tag := vec.Tags[slot]
64 return BoolValue(vec.Values[tag], vec.ForwardTagMap()[slot])
65 case *View:
66 return BoolValue(vec.Any, vec.Index[slot])
67 }
68 panic(vec)
69}

Callers 12

evalMethod · 0.92
boolMaskRidxFunction · 0.92
TestCompareOpsAndFormsFunction · 0.92
evalMethod · 0.92
evalWithNullOrErrorMethod · 0.92
evalWithNullOrErrorMethod · 0.92
FlattenBoolFunction · 0.92
hasTrueFunction · 0.92
CallMethod · 0.92
CallMethod · 0.92
ConsumeMethod · 0.92
ConsumeMethod · 0.92

Calls 3

IsSetMethod · 0.80
ForwardTagMapMethod · 0.80
UnderFunction · 0.70

Tested by 1

TestCompareOpsAndFormsFunction · 0.74