-
Hi there var baseHM = HashMap<int, int>.Empty.Add(1, 1);
var addNewItem = baseHM.Add(2, 2);
var addNewItemAndDeleteIt = baseHM.Add(2, 2).Remove(2);
var setAlreadyAddedWithSameValue = baseHM.SetItem(1, 1);
var setAlreadyAddedWithNewValue = baseHM.SetItem(1, 2);
var toHashMap = baseHM.ToHashMap();
var baseRefEqualsToAddNewItem = baseHM.ReferenceEquals(addNewItem) // <= false
var baseRefEqualsToAddNewItemAndDeleteIt = baseHM.ReferenceEquals(addNewItemAndDeleteIt) // <= false if there is no version caching and change analysis semantics in hashMap/TrieMap
var baseRefEqualsSetAlreadyAddedWithSameValue = baseHM.ReferenceEquals(setAlreadyAddedWithSameValue) // <= true
var baseRefEqualsSetAlreadyAddedWithNewValue = baseHM.ReferenceEquals(setAlreadyAddedWithNewValue) // <= false
var baseRefEqualsToHashMap = baseHM.ReferenceEquals(toHashMap) // <= true |
Beta Was this translation helpful? Give feedback.
Answered by
louthy
Jul 6, 2023
Replies: 1 comment 1 reply
-
You can construct AtomHashMap from your HashMap. It has change-tracking via the Change event. Construction and extraction of the HashMap is low cost, so there's little overhead. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
SicJG
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can construct AtomHashMap from your HashMap. It has change-tracking via the Change event.
Construction and extraction of the HashMap is low cost, so there's little overhead.