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

Function lookupKey

runtime/sam/expr/eval.go:653–662  ·  view source on GitHub ↗
(mapBytes, target scode.Bytes)

Source from the content-addressed store, hash-verified

651}
652
653func lookupKey(mapBytes, target scode.Bytes) (scode.Bytes, bool) {
654 for it := mapBytes.Iter(); !it.Done(); {
655 key := it.Next()
656 val := it.Next()
657 if bytes.Equal(key, target) {
658 return val, true
659 }
660 }
661 return nil, false
662}
663
664// Index represents an index operator "container[index]" where container is
665// either an array (with index type integer) or a record (with index type string).

Callers 1

indexMapFunction · 0.85

Calls 4

IterMethod · 0.80
DoneMethod · 0.45
NextMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected