Skip to content
New issue

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

Fixes for IDs #202

Merged
merged 1 commit into from
Dec 20, 2016
Merged

Fixes for IDs #202

merged 1 commit into from
Dec 20, 2016

Conversation

kobolog
Copy link
Contributor

@kobolog kobolog commented Dec 20, 2016

This PR fixes a bug where ID hashes are never cached. It also reverts IDs to be immutable again.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 77.037% when pulling 4dd8d02 on kobolog/actually-cache-hashes into dc278d0 on master.

Copy link

@xichen2020 xichen2020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -78,6 +78,7 @@ func (v *id) Hash() Hash {
// access to the hash field, compute and cache it.
if atomic.CompareAndSwapInt32(&v.flag, int32(invalid), int32(pending)) {
v.hash = hash(v.data)
atomic.StoreInt32(&v.flag, int32(computed))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a bug fix?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh lol it has the "BugFix" label

Copy link
Collaborator

@robskillington robskillington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kobolog kobolog merged commit 8901f9b into master Dec 20, 2016
@kobolog kobolog deleted the kobolog/actually-cache-hashes branch December 20, 2016 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants