Skip to content

Optimize toArray (#1060)#1061

Closed
re-thc wants to merge 2 commits intojava-native-access:masterfrom
re-thc:master
Closed

Optimize toArray (#1060)#1061
re-thc wants to merge 2 commits intojava-native-access:masterfrom
re-thc:master

Conversation

@re-thc
Copy link
Copy Markdown
Contributor

@re-thc re-thc commented Jan 23, 2019

replace toArray(new T[size]) with toArray(new T[0]) for better performance

replace toArray(new T[size]) with toArray(new T[0]) for better performance
@matthiasblaesing
Copy link
Copy Markdown
Member

I'm not sure, that we are seeing the hotpaths here, but then the code get smaller and thus more readable. I'm inclined to merge this. For user facing changes we require an entry into CHANGES.md documenting the change. You can opt-in to do it for this case, I would consider it a feature. Please refer to the other entries as a reference.

In anycase, I'd like to see the commit message updated to reflect the reasoning (the "why") - short summary of the results Aleksey Shipilёv presents, with the link. That way, when someone looks at the history/annotated file, he/she can understand why the change was done. You can update it by doing an "amend" commit and force-push the change (that could also include the change to CHANGES.md, if you decide to add one).

@re-thc
Copy link
Copy Markdown
Contributor Author

re-thc commented Jan 25, 2019

I've made changes to CHANGES.md. Hope it's ok now. Thanks for reviewing.

@matthiasblaesing
Copy link
Copy Markdown
Member

Merged via 07f3ce0, I updated CHANGES.md and the commit messages and squashed it into one commit. Thank you for your work.

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