chaokunyang commented on code in PR #3048:
URL: https://github.com/apache/fory/pull/3048#discussion_r2616290147


##########
java/fory-core/src/main/java/org/apache/fory/resolver/MapRefResolver.java:
##########
@@ -52,15 +52,16 @@ public final class MapRefResolver implements RefResolver {
   private long writeTotalObjectSize = 0;
   private long readCounter;
   private long readTotalObjectSize = 0;
-  private final IdentityObjectIntMap<Object> writtenObjects =
-      new IdentityObjectIntMap<>(DEFAULT_MAP_CAPACITY, 0.51f);
+  private final IdentityObjectIntMap<Object> writtenObjects;
   private final ObjectArray readObjects = new 
ObjectArray(DEFAULT_ARRAY_CAPACITY);
   private final IntArray readRefIds = new IntArray(DEFAULT_ARRAY_CAPACITY);
 
   // last read object which is not a reference
   private Object readObject;
 
-  public MapRefResolver() {}
+  public MapRefResolver(int size, float loadFactor) {
+    writtenObjects = new IdentityObjectIntMap<>(size, loadFactor);

Review Comment:
   I think the size in unnecessary, after the resize, it never shrink



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