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

Method ForEachWrite

internal/utils/sync/map_int.go:120–128  ·  view source on GitHub ↗
(iterator func(k K, v V))

Source from the content-addressed store, hash-verified

118}
119
120func (this *IntMap[K, V]) ForEachWrite(iterator func(k K, v V)) {
121 for i := 0; i < this.count; i++ {
122 this.lockers[i].Lock()
123 for k, v := range this.m[i] {
124 iterator(k, v)
125 }
126 this.lockers[i].Unlock()
127 }
128}
129
130func (this *IntMap[K, V]) index(k K) int {
131 var index = int(k % K(this.count))

Callers

nothing calls this directly

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected