Skip to content

BitArray in C#: .NET 10, examples and an And benchmark - #2361

Merged
vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/77973-csharp-bitarray
Nov 22, 2026
Merged

vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/77973-csharp-bitarray

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Moves the BitArray in CSharp sample to net10.0 with current BenchmarkDotNet, xUnit, test SDK and coverlet versions, adds Examples.cs with the snippets the article shows (run by default, benchmarks run with --bench), adds a BitArrayAndBenchmark that compares BitArray.And with a bool[] loop, switches the sample files to file-scoped namespaces and adds six tests covering bit order, LeftShift direction, HasAnySet and HasAllSet, CopyTo into a byte array, counting set bits and the And length check.

Target net10.0 and update BenchmarkDotNet, xUnit, the test SDK and coverlet. Add Examples.cs with the snippets the article shows, run them by default and the benchmarks with --bench, add BitArrayAndBenchmark, move to file-scoped namespaces and add six tests for bit order, shifts, HasAnySet/HasAllSet, CopyTo, counting set bits and And length mismatch.
@vladimir-pecanac-main
vladimir-pecanac-main merged commit b98e861 into CodeMazeBlog:main Nov 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant