Skip to content

Conversation

@zhengruifeng
Copy link
Contributor

What changes were proposed in this pull request?

Array[T]() -> Array.empty[T] to avoid allocating 0-length arrays.
Use regex find . -name '*.scala' | xargs -i bash -c 'egrep "Array\[[A-Za-z]+\]\(\)" -n {} && echo {}' to find modification candidates.

cc @srowen

How was this patch tested?

existing tests

@srowen
Copy link
Member

srowen commented Oct 20, 2016

Yes, I'm OK with this. I intentionally didn't change these in the original change because they're just in test code and wanted to keep the change slimmer. But this shouldn't hurt.

@zhengruifeng
Copy link
Contributor Author

@srowen Yes. Only two changes are in main, others are all in testsuites.

@SparkQA
Copy link

SparkQA commented Oct 20, 2016

Test build #67250 has finished for PR 15564 at commit 50eb61a.

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

@srowen
Copy link
Member

srowen commented Oct 21, 2016

Merged to master

@asfgit asfgit closed this in a8ea4da Oct 21, 2016
@zhengruifeng zhengruifeng deleted the avoid_0_length_array branch October 21, 2016 08:52
robert3005 pushed a commit to palantir/spark that referenced this pull request Nov 1, 2016
## What changes were proposed in this pull request?

`Array[T]()` -> `Array.empty[T]` to avoid allocating 0-length arrays.
Use regex `find . -name '*.scala' | xargs -i bash -c 'egrep "Array\[[A-Za-z]+\]\(\)" -n {} && echo {}'` to find modification candidates.

cc srowen

## How was this patch tested?
existing tests

Author: Zheng RuiFeng <[email protected]>

Closes apache#15564 from zhengruifeng/avoid_0_length_array.
uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
## What changes were proposed in this pull request?

`Array[T]()` -> `Array.empty[T]` to avoid allocating 0-length arrays.
Use regex `find . -name '*.scala' | xargs -i bash -c 'egrep "Array\[[A-Za-z]+\]\(\)" -n {} && echo {}'` to find modification candidates.

cc srowen

## How was this patch tested?
existing tests

Author: Zheng RuiFeng <[email protected]>

Closes apache#15564 from zhengruifeng/avoid_0_length_array.
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