MCPcopy Create free account
hub / github.com/aceld/zinx / createShardLockMaps

Function createShardLockMaps

zutils/shard_lock_map.go:32–42  ·  view source on GitHub ↗

createShardLockMaps Creates a new concurrent map.

(hash IHash, shardCount int)

Source from the content-addressed store, hash-verified

30
31// createShardLockMaps Creates a new concurrent map.
32func createShardLockMaps(hash IHash, shardCount int) ShardLockMaps {
33 slm := ShardLockMaps{
34 shards: make([]*SingleShardMap, shardCount),
35 hash: hash,
36 shardCount: shardCount,
37 }
38 for i := 0; i < shardCount; i++ {
39 slm.shards[i] = &SingleShardMap{items: make(map[string]interface{})}
40 }
41 return slm
42}
43
44// NewShardLockMaps creates a new ShardLockMaps with default shard count.
45// Example usage:

Callers 4

NewShardLockMapsFunction · 0.85
NewWithCustomHashFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected