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

Use hook to set map key after setter #11

Merged
merged 2 commits into from
Oct 11, 2024
Merged

Use hook to set map key after setter #11

merged 2 commits into from
Oct 11, 2024

Conversation

klaidliadon
Copy link
Contributor

A struct map value is not addressable, so even if we create a new addressable copy, we lose the addressable property the moment we set it in the map, since we dereference it.

The solution is to set the value in the map after the setters.

This change collect the set operation in the collector as hooks, that get executed after the setters are done.

Copy link
Contributor

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the fix :)

@VojtechVitek VojtechVitek merged commit 4379e2b into master Oct 11, 2024
1 check passed
@VojtechVitek VojtechVitek deleted the setMapValue branch October 11, 2024 12:11
VojtechVitek added a commit that referenced this pull request Oct 14, 2024
This reverts commit 4379e2b, reversing
changes made to ebefdc2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants