createShardLockMaps Creates a new concurrent map.
(hash IHash, shardCount int)
| 30 | |
| 31 | // createShardLockMaps Creates a new concurrent map. |
| 32 | func 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: |
no outgoing calls
no test coverage detected