Closed DevDrake closed 2 years ago
While build-in types should be used when possible, The SortedDictionary type you mentioned is unusable in this case since the Red-black tree node color that needs to be written to the compound files' directory entries isn't exposed by that type's API.
The reason OpenMCDF contains a Red-black tree implementation is because the compound file specification requires one. Because of those requirements, even if a datatype uses a Red-black tree internally doesn't mean it's usable, in this case the tree's node color needs to be accessible from the outside.
Edit: Also see this Stack Overflow answer.
Thank you @Sonic-The-Hedgehog-LNK1123 for the clarification. I've used a custom implementation exactly for the aformentioned reason.
C# currently contains RBTree implementations such as SortedDictionary. For the sake of performance and maintainability build in type should be used.