chaokunyang commented on code in PR #1288:
URL: https://github.com/apache/incubator-fury/pull/1288#discussion_r1438956263


##########
java/fury-core/src/main/java/org/apache/fury/collection/FuryObjectMap.java:
##########
@@ -180,6 +180,7 @@ public V put(K key, V value) {
   /** Skips checks for existing keys, doesn't increment size. */
   private void putResize(K key, V value) {
     K[] keyTable = this.keyTable;
+    V[] valueTable = this.valueTable;

Review Comment:
   This is accessed only once, it's unnecessary to make it as a local variable



##########
java/fury-core/src/main/java/org/apache/fury/collection/Tuple3.java:
##########
@@ -50,6 +52,70 @@ public Tuple3(T0 value0, T1 value1, T2 value2) {
     this.f2 = value2;
   }
 
+  /**
+   * Creates a new tuple and assigns the given values to the tuple's fields, 
with field value
+   * nonFinal.
+   *
+   * @param value0 The value for field 0
+   * @param value1 The value for field 1
+   * @param value2 The value for field 2
+   */
+  public static <T0, T1, T2> NonFinal ofNonFinal(T0 value0, T1 value1, T2 
value2) {
+    return new NonFinal<>(value0, value1, value2);
+  }
+

Review Comment:
   Ditto



##########
java/fury-core/src/main/java/org/apache/fury/collection/Tuple2.java:
##########
@@ -46,6 +48,43 @@ public Tuple2(T0 value0, T1 value1) {
     this.f1 = value1;
   }
 
+  public static class NonFinal<T0, T1> implements Serializable {

Review Comment:
   
   Make this as a top level class, maybe name it as MutableTuple2?



##########
java/fury-core/src/main/java/org/apache/fury/collection/ObjectIntMap.java:
##########
@@ -92,6 +92,7 @@ public void put(K key, int value) {
 
   private void putResize(K key, int value) {
     K[] keyTable = this.keyTable;
+    int[] valueTable = this.valueTable;

Review Comment:
   Accessed only once, unnecessary to use a local variable



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