Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ArraySegment with ReadOnlySpan in Batch/Window buffered operators #639

Conversation

Head0nF1re
Copy link
Contributor

@Head0nF1re Head0nF1re commented Feb 21, 2024

resolves #583

Done:

  • Add a Func-like delegate ReadOnlySpanFunc for ReadOnlySpan since ref structs can't be used as type parameter.

  • Replace ArraySegment with ReadOnlySpan in Batch/Window buffered operators, since ReadOnlySpan provides a truly readonly view of the memory segment (the content of the buffer can't be modified).

  • Add new public methods to PublicAPI.

  • Add BreakingFunc.OfSpan in BreakingFunc file and update tests.

- Add a Func delegate for ReadOnlySpan.

- Replace ArraySegment with ReadOnlySpan in Batch/Window buffered
  operators.

- Add new public methods to PublicAPI.

- Add BreakingReadOnlySpanFunc in BreakingFunc file.
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1c63c16) 95.28% compared to head (9aebbf6) 95.28%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #639   +/-   ##
=======================================
  Coverage   95.28%   95.28%           
=======================================
  Files         248      248           
  Lines        8648     8648           
  Branches     1592     1592           
=======================================
  Hits         8240     8240           
  Misses        217      217           
  Partials      191      191           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -25,18 +25,18 @@ public void BatchValidatesSize()

_ = Assert.Throws<ArgumentOutOfRangeException>("size",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@viceroypenguin In BatchTests:

  • BatchValidatesSize validates the exceptions thrown when size is invalid. Should we do the same for the other arguments?

@Head0nF1re Head0nF1re marked this pull request as ready for review February 22, 2024 17:08
@viceroypenguin viceroypenguin merged commit 886ca78 into viceroypenguin:master Feb 22, 2024
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.

Updated Batch/Window operators to use ReadOnlySpan<>
2 participants