You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/02/25 13:16:55 UTC

[dubbo] branch master updated: Use loadFactor 1.0 when new a unchanged hashmap (#6659)

This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new 530bc17  Use loadFactor 1.0 when new a unchanged hashmap (#6659)
530bc17 is described below

commit 530bc171eaa0a1ce1be3a8597ecc7502e3d00787
Author: tswstarplanet <ts...@apache.org>
AuthorDate: Thu Feb 25 21:16:42 2021 +0800

    Use loadFactor 1.0 when new a unchanged hashmap (#6659)
---
 .../org/apache/dubbo/config/context/ConfigConfigurationAdapter.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dubbo-common/src/main/java/org/apache/dubbo/config/context/ConfigConfigurationAdapter.java b/dubbo-common/src/main/java/org/apache/dubbo/config/context/ConfigConfigurationAdapter.java
index dca7978..3251f63 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/config/context/ConfigConfigurationAdapter.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/config/context/ConfigConfigurationAdapter.java
@@ -32,7 +32,7 @@ public class ConfigConfigurationAdapter implements Configuration {
 
     public ConfigConfigurationAdapter(AbstractConfig config) {
         Map<String, String> configMetadata = config.getMetaData();
-        metaData = new HashMap<>(configMetadata.size());
+        metaData = new HashMap<>(configMetadata.size(), 1.0f);
         for (Map.Entry<String, String> entry : configMetadata.entrySet()) {
             String prefix = config.getPrefix().endsWith(".") ? config.getPrefix() : config.getPrefix() + ".";
             String id = StringUtils.isEmpty(config.getId()) ? "" : config.getId() + ".";