We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is ConcurrentMap sometimes passed by value and sometimes by reference?
// Returns shard under given key func (m ConcurrentMap) GetShard(key <KEY>) *ConcurrentMapShared { hasher := fnv.New32() hasher.Write([]byte(key)) return m[int(hasher.Sum32())%SHARD_COUNT] } // Sets the given value under the specified key. func (m *ConcurrentMap) Set(key <KEY>, value <VAL>) { // Get map shard. shard := m.GetShard(key) shard.Lock() defer shard.Unlock() shard.items[key] = value }
The text was updated successfully, but these errors were encountered:
No good reason really. Your'e welcome to send a PR to fix this :-)
Sorry, something went wrong.
No branches or pull requests
Why is ConcurrentMap sometimes passed by value and sometimes by reference?
The text was updated successfully, but these errors were encountered: