MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / Put

Method Put

internal/utils/sync/map_int.go:44–49  ·  view source on GitHub ↗
(k K, v V)

Source from the content-addressed store, hash-verified

42}
43
44func (this *IntMap[K, V]) Put(k K, v V) {
45 var index = this.index(k)
46 this.lockers[index].Lock()
47 this.m[index][k] = v
48 this.lockers[index].Unlock()
49}
50
51func (this *IntMap[K, V]) PutCompact(k K, v V, compactFunc func(oldV V, newV V) V) {
52 var index = this.index(k)

Calls 3

indexMethod · 0.95
LockMethod · 0.45
UnlockMethod · 0.45