Delete removes a value from the map. If key doesn't exist in the map, this method is a no-op.
(key K)
| 61 | // Delete removes a value from the map. If key doesn't exist in the map, |
| 62 | // this method is a no-op. |
| 63 | func (m ShardedMap[K, V]) Delete(key K) { |
| 64 | shard := m.getShard(key) |
| 65 | shard.Lock() |
| 66 | defer shard.Unlock() |
| 67 | |
| 68 | delete(shard.items, key) |
| 69 | } |
| 70 | |
| 71 | // Get retrieves and returns a value from the map. If the value doesn't exist, |
| 72 | // nil is returned. |