Task: Create lower-level implementation of LinkedDictionary<TKey, TValue> #11
Labels
is:enhancement
New feature or request
pri:normal
up for grabs
This issue is open to be worked on by anyone
Milestone
The
LinkedDictionary<TKey, TValue>
is a composite type that internally is using aLinkedList<T>
andDictionary<TKey, TValue>
. This is a stopgap to get the behavior we need, but we could achieve better performance by using a lower-level hashtable structure to manage the a single collection of items rather than having 2 collections.The main differences between
Dictionary<TKey, TValue>
andLinkedDictionary<TKey, TValue>
are:LinkedDictionary<TKey, TValue>
maintains insertion order across editsLinkedDictionary<TKey, TValue>
allows anull
keyUpdate
.NET 9.0 now includes an
OrderedDictionary<TKey, TValue>
that should provide the correct functionality. It is MIT licensed, so there is no issue with copying it. We need to evaluate the collection to ensure it behaves correctly. It does not supportnull
keys, which is why we will still need to bring it into our project and modify it. I believe we can simply return 0 for anull
hash key and run the same lookup code, but if not check the source code of LinkedHashMap.java in Apache Harmony (which is Apache 2.0 licensed code).We already have tests in
J2N.Tests.xUnit
to confirm it behaves as expected, however we should also review the tests Microsoft provides forOrderedDictionary<TKey, TValue>
to determine whether there are any gaps that we missed.The text was updated successfully, but these errors were encountered: