MCPcopy Create free account
hub / github.com/coder/coder / copyPostings

Function copyPostings

agent/filefinder/delta.go:98–104  ·  view source on GitHub ↗
(m map[K][]uint32)

Source from the content-addressed store, hash-verified

96func (idx *Index) Len() int { return len(idx.byPath) }
97
98func copyPostings[K comparable](m map[K][]uint32) map[K][]uint32 {
99 cp := make(map[K][]uint32, len(m))
100 for k, v := range m {
101 cp[k] = v[:len(v):len(v)]
102 }
103 return cp
104}
105
106// Snapshot returns a frozen read-only view of the index.
107func (idx *Index) Snapshot() *Snapshot {

Callers 1

SnapshotMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected