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

Method Has

BaseServer/concurrentHashMap.go:147–155  ·  view source on GitHub ↗

Looks up an item under specified key

(key string)

Source from the content-addressed store, hash-verified

145
146// Looks up an item under specified key
147func (m ConcurrentHashMap) Has(key string) bool {
148 // Get shard
149 shard := m.GetShard(key)
150 shard.RLock()
151 // See if element is within shard.
152 _, ok := shard.items[key]
153 shard.RUnlock()
154 return ok
155}
156
157// Removes an element from the map.
158func (m ConcurrentHashMap) Remove(key string) {

Callers

nothing calls this directly

Calls 1

GetShardMethod · 0.95

Tested by

no test coverage detected