Skip to content

[MINOR][ML] Array.fill(0) -> Array.ofDim; Array.empty[Int] -> Array.emptyIntArray#27133

Closed
zhengruifeng wants to merge 2 commits intoapache:masterfrom
zhengruifeng:minor_fill_ofDim
Closed

[MINOR][ML] Array.fill(0) -> Array.ofDim; Array.empty[Int] -> Array.emptyIntArray#27133
zhengruifeng wants to merge 2 commits intoapache:masterfrom
zhengruifeng:minor_fill_ofDim

Conversation

@zhengruifeng
Copy link
Contributor

What changes were proposed in this pull request?

1, for primitive types Array.fill(n)(0) -> Array.ofDim(n);
2, for AnyRef types Array.fill(n)(null) -> Array.ofDim(n);
3, for primitive types Array.empty[XXX] -> Array.emptyXXXArray

Why are the changes needed?

Array.ofDim avoid assignments;
Array.emptyXXXArray avoid create new object;

Does this PR introduce any user-facing change?

No

How was this patch tested?

existing testsuites

init

update

update

update

init
@zhengruifeng zhengruifeng added the ML label Jan 8, 2020
@SparkQA
Copy link

SparkQA commented Jan 8, 2020

Test build #116290 has finished for PR 27133 at commit aa9240f.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

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

Looks good if tests pass

@SparkQA
Copy link

SparkQA commented Jan 8, 2020

Test build #116298 has finished for PR 27133 at commit 873dce0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

Merged to master.

@zhengruifeng zhengruifeng deleted the minor_fill_ofDim branch January 9, 2020 02:20
@zhengruifeng
Copy link
Contributor Author

@HyukjinKwon Thanks for reviewing!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants