Change BitHelper in System.Collections to be a ref struct
authorStephen Toub <stoub@microsoft.com>
Sun, 6 Jan 2019 15:25:16 +0000 (10:25 -0500)
committerStephen Toub <stoub@microsoft.com>
Tue, 8 Jan 2019 14:49:57 +0000 (09:49 -0500)
commiteb67f7522f2a548c223bde9b0303dbf2f024e753
tree125cdbe5b7e98dea4991bd27a7533752f96a5b66
parent8fd85a520b962acf184535cfbca1c73e74be63e7
Change BitHelper in System.Collections to be a ref struct

Simplifies BitHelper, basing it on span instead of having to accomodate both pointers and arrays, and avoids allocating the BitHelper instance.  We now also clear the input optionally.

Commit migrated from https://github.com/dotnet/corefx/commit/82ce02db86987eb8947b9f09b76cd0658aaf2dce
src/libraries/System.Collections/src/System/Collections/Generic/BitHelper.cs
src/libraries/System.Collections/src/System/Collections/Generic/HashSet.cs
src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs