MCPcopy
hub / github.com/zincsearch/zincsearch / Add

Method Add

pkg/zutils/hash/rendezvous/rendezvous.go:97–107  ·  view source on GitHub ↗
(node string)

Source from the content-addressed store, hash-verified

95}
96
97func (r *Rendezvous) Add(node string) {
98 if r.Contains(node) {
99 return
100 }
101
102 r.lock.Lock()
103 r.nodes[node] = len(r.nstr)
104 r.nstr = append(r.nstr, node)
105 r.nhash = append(r.nhash, r.Hash(node))
106 r.lock.Unlock()
107}
108
109func (r *Rendezvous) Remove(node string) {
110 r.lock.Lock()

Callers 4

TestRendezvous_LookupFunction · 0.45
TestRendezvous_ListFunction · 0.45
TestRendezvous_LenFunction · 0.45

Calls 2

ContainsMethod · 0.95
HashMethod · 0.95

Tested by 4

TestRendezvous_LookupFunction · 0.36
TestRendezvous_ListFunction · 0.36
TestRendezvous_LenFunction · 0.36