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

Method ForEachRead

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

Source from the content-addressed store, hash-verified

108}
109
110func (this *IntMap[K, V]) ForEachRead(iterator func(k K, v V)) {
111 for i := 0; i < this.count; i++ {
112 this.lockers[i].RLock()
113 for k, v := range this.m[i] {
114 iterator(k, v)
115 }
116 this.lockers[i].RUnlock()
117 }
118}
119
120func (this *IntMap[K, V]) ForEachWrite(iterator func(k K, v V)) {
121 for i := 0; i < this.count; i++ {

Callers 2

TestIntMap_ForEachReadFunction · 0.80
TestIntMap_ForEachWriteFunction · 0.80

Calls 2

RLockMethod · 0.80
RUnlockMethod · 0.80

Tested by 2

TestIntMap_ForEachReadFunction · 0.64
TestIntMap_ForEachWriteFunction · 0.64