From ec67231b76059d95a4425b0fd8687cbb427f4807 Mon Sep 17 00:00:00 2001 From: Hiroaki Yoshida Date: Tue, 19 Feb 2019 13:35:04 -0800 Subject: [PATCH] Fix inefficient use of keySet iterator instead of entrySet iterator --- .../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 620c534fb8e..9af39888e21 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 static ProviderInvokerWrapper getProviderWrapper(URL registeredPro return null; } - for (Invoker inv : invokers.keySet()) { - if (inv == invoker) { - return invokers.get(inv); + for (Map.Entry entry : invokers.entrySet()) { + if (entry.getKey() == invoker) { + return entry.getValue(); } }