myui commented on a change in pull request #178: [HIVEMALL-233] RandomForest 
regressor accepts sparse vector input
URL: https://github.com/apache/incubator-hivemall/pull/178#discussion_r249587117
 
 

 ##########
 File path: 
core/src/main/java/hivemall/utils/collections/lists/DoubleArrayList.java
 ##########
 @@ -70,7 +70,7 @@ public DoubleArrayList add(@Nonnull double[] values) {
     private void expand(int max) {
         while (data.length < max) {
             final int len = data.length;
-            double[] newArray = new double[len * 2];
+            double[] newArray = new double[(len + 1) * 2];
 
 Review comment:
   hmm, this PR does not resolves a potential bug in expand. Returning array 
should be `>= max` and `max` should be `minCapacity` where `expand`'s argument 
is expected to be >=1.
   
   
https://github.com/karussell/fastutil/blob/master/src/it/unimi/dsi/fastutil/doubles/DoubleArrayList.java#L203
   
https://github.com/karussell/fastutil/blob/master/src/it/unimi/dsi/fastutil/doubles/DoubleArrays.java#L136
   
   Let me fix this in another PR.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to