You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@druid.apache.org by GitBox <gi...@apache.org> on 2018/07/08 14:53:50 UTC

[GitHub] asdf2014 commented on a change in pull request #5957: Various changes

asdf2014 commented on a change in pull request #5957: Various changes
URL: https://github.com/apache/incubator-druid/pull/5957#discussion_r200843245
 
 

 ##########
 File path: processing/src/main/java/io/druid/query/aggregation/JavaScriptAggregatorFactory.java
 ##########
 @@ -353,6 +354,15 @@ public double aggregate(final double current, final BaseObjectColumnValueSelecto
         return Context.toNumber(res);
       }
 
+      private Object[] arrayToObjectArray(Object array)
+      {
+        final Object[] objectArray = new Object[Array.getLength(array)];
+        for (int j = 0; j < Array.getLength(array); j++) {
 
 Review comment:
   Maybe this line of code can become this way?
   
   ```java
   int len = Array.getLength(array);
   final Object[] objectArray = new Object[len];
   for (int j = 0; j < len; j++) {...}
   ```
   
   Cuz, `for (int j = 0; j < Array.getLength(array); j++) {...}` this code style will call `Array.getLength` method for each `for` loop.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@druid.apache.org
For additional commands, e-mail: dev-help@druid.apache.org