-
Notifications
You must be signed in to change notification settings - Fork 453
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
Fixes for IDs #202
Conversation
There was a problem hiding this 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)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR fixes a bug where ID hashes are never cached. It also reverts IDs to be immutable again.