MCPcopy Index your code
hub / github.com/aceld/zinx / Clear

Method Clear

zutils/shard_lock_map.go:238–242  ·  view source on GitHub ↗

Clear removes all items from map.

()

Source from the content-addressed store, hash-verified

236
237// Clear removes all items from map.
238func (slm ShardLockMaps) Clear() {
239 for item := range slm.IterBuffered() {
240 slm.Remove(item.Key)
241 }
242}
243
244// LockFuncWithKey executes a function with write lock on the shard containing the key.
245// WARNING: Do not perform operations on the container within f to avoid deadlocks.

Callers 1

TestClearFunction · 0.95

Calls 2

IterBufferedMethod · 0.95
RemoveMethod · 0.95

Tested by 1

TestClearFunction · 0.76