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

Method LookupType

context.go:676–691  ·  view source on GitHub ↗
(id int)

Source from the content-addressed store, hash-verified

674}
675
676func (t *TypeCache) LookupType(id int) (Type, error) {
677 if id < len(t.cache) {
678 if typ := t.cache[id]; typ != nil {
679 return typ, nil
680 }
681 }
682 typ, err := t.fetcher.LookupType(id)
683 if err != nil {
684 return nil, err
685 }
686 if id >= len(t.cache) {
687 t.cache = slices.Grow(t.cache[:0], id+1)[:id+1]
688 }
689 t.cache[id] = typ
690 return typ, nil
691}

Callers

nothing calls this directly

Calls 2

GrowMethod · 0.80
LookupTypeMethod · 0.65

Tested by

no test coverage detected