Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@guizmaii
Copy link
Member

No description provided.

* access to the size of the list, which allows us to optimize the chunk
* building process.
*/
def fromJavaList[A](list: java.util.List[A]): Chunk[A] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool!

Copy link
Contributor

Choose a reason for hiding this comment

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

But I think you can test if the passing in is a List in fromJavaIterable too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea! :)

Copy link
Member Author

Choose a reason for hiding this comment

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

@He-Pin I made the change. I used java.util.Collection instead of java.util.List as java.util.List is extending java.util.Collection and it also has this abstract size method.

Let me know what you think :)

@guizmaii guizmaii changed the title Add Chunk.fromJavaList Call sizeHint in Chunk.fromJavaIterable when possible Mar 27, 2023
@guizmaii guizmaii marked this pull request as ready for review March 27, 2023 11:52
@adamgfraser adamgfraser merged commit f8a3705 into zio:series/2.x Mar 27, 2023
@guizmaii guizmaii deleted the fromJavaList branch March 27, 2023 13:46
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.

3 participants