-
Notifications
You must be signed in to change notification settings - Fork 74
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
Switch back to MutableMap
to avoid scatter map bug
#2438
Conversation
idToNode[lastCreatedId.value] = ReuseNode( | ||
widgetId = lastCreatedId, |
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.
Switch to local which already has the same value as change.id
changesAndNulls: Array<Change?>, | ||
pooled: ProtocolNode<W>, | ||
) { | ||
// Reuse the node. | ||
pooled.id = widgetId |
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.
No need to lookup the Create
, we already have a member with the new ID.
Took a quick look around at other scatter-based map and set usage. They don't have this long-lived put/remove pattern. |
childrenTag = ChildrenTag.Root, | ||
idToNode[lastCreatedId.value] = ReuseNode( | ||
widgetId = lastCreatedId, | ||
// This is the root of the reuse tree, so it will never have a children tag from a parent. |
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.
Thanks
Sometimes the scatter-based maps can return values from other keys when inserting a new key. See https://issuetracker.google.com/issues/378077858.
2052c85
to
0fc9fff
Compare
Sometimes the scatter-based maps can return values from other keys when inserting a new key. See https://issuetracker.google.com/issues/378077858.
CHANGELOG.md
's "Unreleased" section has been updated, if applicable.