Skip to content

fix: only notify when the collection was modified.#435

Merged
rodydavis merged 4 commits intorodydavis:mainfrom
zupat:list.remove-bug
Dec 12, 2025
Merged

fix: only notify when the collection was modified.#435
rodydavis merged 4 commits intorodydavis:mainfrom
zupat:list.remove-bug

Conversation

@zupat
Copy link
Contributor

@zupat zupat commented Dec 10, 2025

Currenly, every call to list.remove/set.remove notifies listeners even if nothing was removed.

I didn't do this for map because map.remove returns null if the value wasn't in the map but map can allow null values so we are not sure if it was removed or not.

edit:
I added the fix for map, it checks the length before and after to verify that the value was removed.

Copy link
Owner

@rodydavis rodydavis left a comment

Choose a reason for hiding this comment

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

This is a nice improvement! Thanks!

LGTM.

I believe List and Map both have this behavior

@rodydavis rodydavis merged commit cefb489 into rodydavis:main Dec 12, 2025
3 checks passed
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