[
https://issues.apache.org/jira/browse/TAJO-2058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15198695#comment-15198695
]
ASF GitHub Bot commented on TAJO-2058:
--------------------------------------
Github user eminency commented on a diff in the pull request:
https://github.com/apache/tajo/pull/944#discussion_r56452167
--- Diff: tajo-core/src/main/java/org/apache/tajo/querymaster/Query.java ---
@@ -303,12 +304,7 @@ public QueryHistory getQueryHistory() {
}
private List<StageHistory> makeStageHistories() {
- List<StageHistory> stageHistories = new ArrayList<>();
- for(Stage eachStage : getStages()) {
- stageHistories.add(eachStage.getStageHistory());
- }
-
- return stageHistories;
+ return
getStages().stream().map(Stage::getStageHistory).collect(Collectors.toList());
--- End diff --
It can be put into caller directly.
> foreach loop can be collapsed with stream api
> ---------------------------------------------
>
> Key: TAJO-2058
> URL: https://issues.apache.org/jira/browse/TAJO-2058
> Project: Tajo
> Issue Type: Improvement
> Reporter: Dongkyu Hwangbo
> Assignee: Dongkyu Hwangbo
> Priority: Minor
> Labels: migration, stream
>
> Currently, TAJO has many foreach loop. To make project more stream-friendly,
> replacing this loop with stream api is needed.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)