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

Specialize Chunk#toArraySlice #3198

Merged
merged 6 commits into from
Apr 3, 2023

Conversation

armanbilge
Copy link
Member

  1. Specializes Chunk#toArraySlice for ByteVector and {Byte,Char}Buffer to avoid array copies.
  2. Fix class cast exceptions in Chunk.{Byte,Char}Buffer#toArray.
  3. Avoid converting buffers to read-only, since this prevents access to underlying array.
  4. Use toArraySlice to implement to{Byte,Char}Buffer

core/shared/src/test/scala/fs2/ChunkSuite.scala Outdated Show resolved Hide resolved
core/shared/src/test/scala/fs2/ChunkSuite.scala Outdated Show resolved Hide resolved
@armanbilge
Copy link
Member Author

@armanbilge
Copy link
Member Author

Actually, maybe we shouldn't be comparing ClassTags for equality at all.

@diesalbla diesalbla merged commit aa60723 into typelevel:main Apr 3, 2023
@armanbilge
Copy link
Member Author

@diesalbla I'd appreciate it if you didn't squash-merge my PRs 😕 I worked carefully to split this PR into a series of easy-to-review commits.

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.

2 participants