MCPcopy Create free account
hub / github.com/Super-long/ChubbyGo / Get

Method Get

BaseServer/concurrentHashMap.go:130–138  ·  view source on GitHub ↗

Retrieves an element from map under given key.

(key string)

Source from the content-addressed store, hash-verified

128
129// Retrieves an element from map under given key.
130func (m ConcurrentHashMap) Get(key string) (interface{}, bool) {
131 // Get shard
132 shard := m.GetShard(key)
133 shard.RLock()
134 // Get item from shard.
135 val, ok := shard.items[key]
136 shard.RUnlock()
137 return val, ok
138}
139
140// Returns the number of elements within the map.
141// 返回目前map中的数据总量

Callers

nothing calls this directly

Calls 1

GetShardMethod · 0.95

Tested by

no test coverage detected