Skip to content

Commit

Permalink
Use newHashMapWithExpectedSize instead of new HashMap
Browse files Browse the repository at this point in the history
  • Loading branch information
mziccard committed Oct 23, 2015
1 parent 87bc1a1 commit 682848a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -420,7 +421,7 @@ public ObjectAccessControl apply(Acl acl) {
}
Map<String, String> 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.<String>nullOf(String.class)));
}
Expand Down

0 comments on commit 682848a

Please sign in to comment.