From 682848a60389769e66c7a0e4e6f3ec4ac7dad572 Mon Sep 17 00:00:00 2001 From: Marco Ziccardi Date: Fri, 23 Oct 2015 19:50:53 +0200 Subject: [PATCH] Use newHashMapWithExpectedSize instead of new HashMap --- .../src/main/java/com/google/gcloud/storage/BlobInfo.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcloud-java-storage/src/main/java/com/google/gcloud/storage/BlobInfo.java b/gcloud-java-storage/src/main/java/com/google/gcloud/storage/BlobInfo.java index eb490db0f9fb..ec3ef36708cb 100644 --- a/gcloud-java-storage/src/main/java/com/google/gcloud/storage/BlobInfo.java +++ b/gcloud-java-storage/src/main/java/com/google/gcloud/storage/BlobInfo.java @@ -29,6 +29,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import java.io.Serializable; import java.math.BigInteger; @@ -420,7 +421,7 @@ public ObjectAccessControl apply(Acl acl) { } Map pbMetadata = metadata; if (metadata != null && !Data.isNull(metadata)) { - pbMetadata = new HashMap<>(); + pbMetadata = Maps.newHashMapWithExpectedSize(metadata.size()); for (String key : metadata.keySet()) { pbMetadata.put(key, firstNonNull(metadata.get(key), Data.nullOf(String.class))); }