Looks up an item under specified key
(key string)
| 145 | |
| 146 | // Looks up an item under specified key |
| 147 | func (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. |
| 158 | func (m ConcurrentHashMap) Remove(key string) { |