netudima commented on code in PR #4538:
URL: https://github.com/apache/cassandra/pull/4538#discussion_r2676002489


##########
src/java/org/apache/cassandra/utils/btree/BTree.java:
##########
@@ -1316,6 +1317,55 @@ public static <I, O> Object[] transform(Object[] tree, 
Function<? super I, ? ext
         return result;
     }
 
+    /**
+     * Takes a tree and transforms it using the provided function.
+     * The result of any transformation must sort identically as their 
originals, wrt other results.
+     * <p>
+     * If no modifications are made, the original is returned.
+     * NOTE: codewise *identical* to {@link #transform(Object[], Function)}
+     */
+    public static <I, I2, O> Object[] transform(Object[] tree, BiFunction<? 
super I, ? super I2, ? extends O> function, I2 param)

Review Comment:
   I think it would be better to keep the original generic style, reasons:
   1) (coupling) BTree is a generic utility logic, it is better to not create 
an unnecessary coupling to specific logic related to memory allocation
   2) (generality/abstraction) the method logic is generic and does not depend 
on the argument type (it is correct for any type),  it can be used in other use 
cases later if needed
   3) (consistency) the same style with generics is ready used in BTree, for 
example: transformAndFilter uses exactly the same style.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to