示例#1
0
func (sm *SafeMap) GetShard(key string) *Shard {
	bucket := util.Sum32([]byte(key)) % uint32(SHARD_COUNT)
	return (*sm)[bucket]
}
示例#2
0
func (m *SafeMap) GetShard(key string) *Shard {
	bucket := util.Sum32([]byte(key)) % uint32(SHARD_COUNT)
	//fmt.Printf("key: %q, bucket: %d\n", key, bucket) // <= Remove this at some point
	return (*m)[bucket]
}