Browse Source

Remove redundant operation when adding child node in NodeSelectorSlot (#794)

master
Lin.Liang Eric Zhao 5 years ago
parent
commit
ee38587a6e
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/nodeselector/NodeSelectorSlot.java

+ 6
- 5
sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/nodeselector/NodeSelectorSlot.java View File

@@ -15,9 +15,6 @@
*/ */
package com.alibaba.csp.sentinel.slots.nodeselector; package com.alibaba.csp.sentinel.slots.nodeselector;


import java.util.HashMap;
import java.util.Map;

import com.alibaba.csp.sentinel.context.Context; import com.alibaba.csp.sentinel.context.Context;
import com.alibaba.csp.sentinel.context.ContextUtil; import com.alibaba.csp.sentinel.context.ContextUtil;
import com.alibaba.csp.sentinel.node.ClusterNode; import com.alibaba.csp.sentinel.node.ClusterNode;
@@ -26,6 +23,9 @@ import com.alibaba.csp.sentinel.node.EntranceNode;
import com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot; import com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot;
import com.alibaba.csp.sentinel.slotchain.ResourceWrapper; import com.alibaba.csp.sentinel.slotchain.ResourceWrapper;


import java.util.HashMap;
import java.util.Map;

/** /**
* </p> * </p>
* This class will try to build the calling traces via * This class will try to build the calling traces via
@@ -160,9 +160,10 @@ public class NodeSelectorSlot extends AbstractLinkedProcessorSlot<Object> {
cacheMap.putAll(map); cacheMap.putAll(map);
cacheMap.put(context.getName(), node); cacheMap.put(context.getName(), node);
map = cacheMap; map = cacheMap;
// Build invocation tree
((DefaultNode) context.getLastNode()).addChild(node);
} }
// Build invocation tree
((DefaultNode)context.getLastNode()).addChild(node);

} }
} }




Loading…
Cancel
Save