Remove removes an element from the map.
(key string)
| 139 | |
| 140 | // Remove removes an element from the map. |
| 141 | func (slm ShardLockMaps) Remove(key string) { |
| 142 | shard := slm.GetShard(key) |
| 143 | shard.Lock() |
| 144 | delete(shard.items, key) |
| 145 | shard.Unlock() |
| 146 | } |
| 147 | |
| 148 | // RemoveCb is a callback executed in a map.RemoveCb() call, while Lock is held |
| 149 | // If returns true, the element will be removed from the map |