You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/06/15 03:05:09 UTC

[GitHub] [bookkeeper] Shoothzj commented on a diff in pull request #3333: List init with capacity

Shoothzj commented on code in PR #3333:
URL: https://github.com/apache/bookkeeper/pull/3333#discussion_r897491744


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieImpl.java:
##########
@@ -426,7 +426,7 @@ public BookieImpl(ServerConfiguration conf,
         }
 
         // instantiate the journals
-        journals = Lists.newArrayList();
+        journals = Lists.newArrayListWithCapacity(journalDirectories.size());

Review Comment:
   I think `new ArrayList<>(size)` is better. Guava also recommend jdk8+ to use `new ArrayList<>()`



-- 
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: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org