Skip to content

Optimize take() for arrays #5424

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pubiqq
Copy link

@pubiqq pubiqq commented Apr 2, 2025

See KT-76501

@MukjepScarlet
Copy link

MukjepScarlet commented Jul 11, 2025

This might break compatibility because some users might use the results of these functions in Java, the original functions use ArrayList and the new implementation uses Arrays.asList (only set)

But I think the standard library never guarantees the result is mutable, so it's safe unless the user cast it to MutableList with Kotlin or use it as mutable List with Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants