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

Function NewIndex

agent/filefinder/delta.go:42–49  ·  view source on GitHub ↗

NewIndex creates an empty Index.

()

Source from the content-addressed store, hash-verified

40
41// NewIndex creates an empty Index.
42func NewIndex() *Index {
43 return &Index{
44 byGram: make(map[uint32][]uint32),
45 byPrefix2: make(map[uint16][]uint32),
46 byPath: make(map[string]uint32),
47 deleted: make(map[uint32]bool),
48 }
49}
50
51// Add inserts a path into the index, tombstoning any previous entry.
52func (idx *Index) Add(path string, flags uint16) uint32 {

Callers 12

TestIndex_AddAndLenFunction · 0.92
TestIndex_HasFunction · 0.92
TestIndex_RemoveFunction · 0.92
TestIndex_AddOverwriteFunction · 0.92
TestIndex_SnapshotFunction · 0.92
TestIndex_TrigramIndexFunction · 0.92
TestIndex_PrefixIndexFunction · 0.92
walkRootFunction · 0.85
MakeTestSnapshotFunction · 0.85

Calls

no outgoing calls

Tested by 11

TestIndex_AddAndLenFunction · 0.74
TestIndex_HasFunction · 0.74
TestIndex_RemoveFunction · 0.74
TestIndex_AddOverwriteFunction · 0.74
TestIndex_SnapshotFunction · 0.74
TestIndex_TrigramIndexFunction · 0.74
TestIndex_PrefixIndexFunction · 0.74
MakeTestSnapshotFunction · 0.68