This repository was archived by the owner on May 12, 2021. It is now read-only.
TAJO-2058: foreach loop can be collapsed with stream api#944
Open
dkhwangbo wants to merge 17 commits intoapache:masterfrom
Open
TAJO-2058: foreach loop can be collapsed with stream api#944dkhwangbo wants to merge 17 commits intoapache:masterfrom
dkhwangbo wants to merge 17 commits intoapache:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Actually in a case like this, I think it's sufficient and more clear.
hash.specifiers.addAll(specifiers);or more simply,
hash.specifiers = new ArrayList<>(specifiers);Anyway, I think stream doesn't matter.
Because it is simple shallow copy, there are many ways.
Contributor
Author
There was a problem hiding this comment.
@eminency Thanks for your comment. I agree with your opinion.
I'll rewrite it overall correlated with a simple shallow copy.
Contributor
|
Time to merge. |
Contributor
Author
|
@eminency Thanks for your comment. Unfortunately, I face with some unsuspected error while travis test. I'm in investigation about it's cause. |
| for (PartitionSpecifier specifier : specifiers) { | ||
| hash.specifiers.add(specifier); | ||
| } | ||
| hash.specifiers = specifiers.stream().collect(Collectors.toList()); |
Contributor
There was a problem hiding this comment.
It is sufficient with:
hash.specifiers = new ArrayList<>(specifiers);
Contributor
|
Even though they may not exact, I left some comments. |
Contributor
Author
|
@eminency Hi! Thanks for your comment. I apply your comment. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I replace many foreach loop with stream api.