Removes an element from the map.
(key string)
| 156 | |
| 157 | // Removes an element from the map. |
| 158 | func (m ConcurrentHashMap) Remove(key string) { |
| 159 | // Try to get shard. |
| 160 | shard := m.GetShard(key) |
| 161 | shard.Lock() |
| 162 | delete(shard.items, key) |
| 163 | shard.Unlock() |
| 164 | } |
| 165 | |
| 166 | // Removes an element from the map and returns it |
| 167 | func (m ConcurrentHashMap) Pop(key string) (v interface{}, exists bool) { |