You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by ca...@apache.org on 2019/02/20 02:40:25 UTC
[incubator-dubbo] branch master updated: Fix inefficient use of
keySet iterator instead of entrySet iterator (#3508)
This is an automated email from the ASF dual-hosted git repository.
carryxyh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new e918fa4 Fix inefficient use of keySet iterator instead of entrySet iterator (#3508)
e918fa4 is described below
commit e918fa4632ee02aff4ef105e0389d42153a3061f
Author: Hiroaki Yoshida <hy...@us.fujitsu.com>
AuthorDate: Tue Feb 19 18:40:17 2019 -0800
Fix inefficient use of keySet iterator instead of entrySet iterator (#3508)
Fix inefficient use of keySet iterator instead of entrySet iterator
---
.../org/apache/dubbo/registry/support/ProviderConsumerRegTable.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/ProviderConsumerRegTable.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/ProviderConsumerRegTable.java
index 620c534..9af3988 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/ProviderConsumerRegTable.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/ProviderConsumerRegTable.java
@@ -72,9 +72,9 @@ public class ProviderConsumerRegTable {
return null;
}
- for (Invoker inv : invokers.keySet()) {
- if (inv == invoker) {
- return invokers.get(inv);
+ for (Map.Entry<Invoker, ProviderInvokerWrapper> entry : invokers.entrySet()) {
+ if (entry.getKey() == invoker) {
+ return entry.getValue();
}
}