Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a variety of issues in FrozenCollections
- Add the new ToFrozenDictionary/Set methods that take optimizedForReading and make the existing overloads cheaper for construction. This makes construction time and allocation by default much closer to that of a normal dictionary or set while also enabling more of the implementation to be trimmed away by default. - Fixed the use of FrozenSet/Dictionary.Empty such that we only use the singleton when its comparer matches; otherwise, we could end up handing back an instance with the wrong comparer. - Avoided passing both a dictionary/set and a comparer down through constructors, as the dictionary/set contains the comparer and we don't want to accidentally end up in a situation where we pass through the wrong one. - Condensed some of the construction code to be a bit less verbose - Removed unused locals from ToFrozenDictionary (the min/max/range were no longer being used) - Remove unnecessary array allocations from PickIntegerDictionary - Delete the sparse range integer sets, which are rarely needed and are broken for TryGetValue - Fix CheckUniqueAndUnfoundElements to slice down to only the relevant size prior to clearing
- Loading branch information
1 parent
f54716d
commit 53412f1
Showing
32 changed files
with
950 additions
and
791 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.