Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
engines/dotnet: make it more idiomatic and improve perf
Performance updates: * Use EnumerateMatches instead of Matches when capture groups aren't needed. * Use Match w/ NextMatch instead of Matches when capture groups are needed. * Use EnumerateLines to avoid materializing strings for each line when not necessary. Idiom updates: * Use switch statements/expressions instead of large cascading if/elses. * Use and slice spans instead of `List<byte>` manipulations. * No need to explicitly use Stream.Read; it can instead copy the input stream to a memory stream and get a span to the memory stream's buffered data. * Change comments to be structured XML comments so that they show up for consumers in IntelliSense / docs / etc. * Use Elapsed.TotalNanoseconds instead of a custom helper. * Use Func<..> instead of custom delegates. * Use ++ instead of += 1. * Use record structs for simple POCOs. Closes #10
- Loading branch information