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'm tracking changes for an ISet<T> and, for some project requirement, I need to clear it and re-add all items in order to re-hash them internally in an implementation like HashSet<T>.
Currently, if I call ICollection<T>.Clear`, items will be cleared, but tracking information will still say that I've removed some items, and I've added some of them. In my particular case, if I had 3 items, clearing the collection ended up in having 6 added items (because they're the same items with a different hash code).
The text was updated successfully, but these errors were encountered:
I've came to an edge case.
I'm tracking changes for an
ISet<T>
and, for some project requirement, I need to clear it and re-add all items in order to re-hash them internally in an implementation likeHashSet<T>
.Currently, if I call
ICollection<T>
.Clear`, items will be cleared, but tracking information will still say that I've removed some items, and I've added some of them. In my particular case, if I had 3 items, clearing the collection ended up in having 6 added items (because they're the same items with a different hash code).The text was updated successfully, but these errors were encountered: