You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using a tuple(Array in JS) as a key with SortedSet.remove.
I found that SortedSet.remove doesn't remove its element when it's not a primitive type.
Even in the case that my custom compare function returns 0, the element won't be deleted.
Just commenting that line out made remove operate as I expected.
Is this intended behavior? Or am I missing something else?
The text was updated successfully, but these errors were encountered:
I've been using a tuple(
Array
in JS) as a key withSortedSet.remove
.I found that
SortedSet.remove
doesn't remove its element when it's not a primitive type.So I investigated the implementation and found that
removeInternal
checks the reference equality before actually removing the element.https://github.com/rimbu-org/rimbu/blob/main/packages/sorted/src/set-custom/implementation/immutable.mts#L435
Even in the case that my custom
compare
function returns0
, the element won't be deleted.Just commenting that line out made
remove
operate as I expected.Is this intended behavior? Or am I missing something else?
The text was updated successfully, but these errors were encountered: