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 argument with empty array #2924

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

Conversation

kang-hl
Copy link

@kang-hl kang-hl commented Jul 31, 2023

Replace argument with empty array

@harawata
Copy link
Member

Hello @kang-hl ,

Could you explain the benefit of this change?

The javadoc says ...

If the set fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this set.

It means that an extra array is created if the argument is an empty array.

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.

None yet

2 participants