[ 
https://issues.apache.org/jira/browse/TAJO-2058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15198691#comment-15198691
 ] 

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_r56451584
  
    --- Diff: 
tajo-core/src/main/java/org/apache/tajo/engine/query/TaskRequestImpl.java ---
    @@ -216,49 +217,42 @@ public Enforcer getEnforcer() {
         return this.fetches;
        }
        
    -   private void initFetches() {
    -     if (this.fetches != null) {
    +  private void initFetches() {
    +    if (this.fetches != null) {
           return;
         }
         TaskRequestProtoOrBuilder p = viaProto ? proto : builder;
    -    this.fetches = new ArrayList<>();
    -    for(FetchProto fetch : p.getFetchesList()) {
    -      fetches.add(fetch);
    -    }
    -   }
    +    this.fetches = 
p.getFetchesList().stream().collect(Collectors.toList());
    --- End diff --
    
    Same as above early.


> 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)

Reply via email to