You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/08/17 01:58:54 UTC

[incubator-servicecomb-java-chassis] 02/02: [SCB-846] optimize code

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

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit e698efa692e5d04208e086b09717826487cd96e7
Author: heyile <he...@huawei.com>
AuthorDate: Thu Aug 16 08:50:22 2018 +0800

    [SCB-846] optimize code
---
 .../org/apache/servicecomb/config/client/ParseConfigUtils.java     | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ParseConfigUtils.java b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ParseConfigUtils.java
index f370728..b51e0d7 100644
--- a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ParseConfigUtils.java
+++ b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ParseConfigUtils.java
@@ -75,15 +75,12 @@ public class ParseConfigUtils {
     try {
       configLock.lock();
       String oldRevision = currentVersionInfo;
-      boolean newVersion = false;
       currentVersionInfo =
           remoteItems.getOrDefault("revision", new HashMap<>()).getOrDefault("version", "default").toString();
       //make sure the currentVersionInfo != ""
       currentVersionInfo = currentVersionInfo.equals("") ? "default" : currentVersionInfo;
-      if (remoteItems.containsKey("revision")) {
-        remoteItems.remove("revision");//the key revision is not the config setting
-        newVersion = true;
-      }
+      //the key revision is not the config setting
+      boolean newVersion = (remoteItems.remove("revision") != null);
       multiDimensionItems.clear();
       multiDimensionItems.putAll(remoteItems);
       doRefreshItems();