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

[SPARK-39298][CORE][SQL][DSTREAM][GRAPHX][ML][MLLIB][SS][YARN] Replace constructing ranges of collection indices manually with .indices #36679

Closed
wants to merge 5 commits into from

Conversation

LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented May 26, 2022

What changes were proposed in this pull request?

This pr is a trivial change: use Seq.indices instead of constructing ranges of collection indices manually.

Before

  var x: Seq[Int]
  Range(0, x.size)
  0 until x.size
  0.to(x.size - 1)

After

var x: Seq[Int]
x.indices

Why are the changes needed?

Use API instead of manual coding.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Pass Github Actions

@LuciferYang LuciferYang changed the title [SPARK-39298][CORE][SQL] Replace constructing ranges of collection indices manually with .indices [SPARK-39298][CORE][SQL][DSTREAM][GRAPHX][ML][MLLIB][SS][YARN] Replace constructing ranges of collection indices manually with .indices May 26, 2022
Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

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

it's trivial, but I think it's OK

@srowen srowen closed this in 5556cfc Jun 14, 2022
@srowen
Copy link
Member

srowen commented Jun 14, 2022

Merged to master

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.

2 participants