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

This commit is contained in:
Lin.Liang 2019-06-04 18:02:43 +08:00 committed by Eric Zhao
parent 3a9e2629b7
commit ee38587a6e
1 changed files with 6 additions and 5 deletions

View File

@ -15,9 +15,6 @@
*/
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.ContextUtil;
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.ResourceWrapper;
import java.util.HashMap;
import java.util.Map;
/**
* </p>
* This class will try to build the calling traces via
@ -160,9 +160,10 @@ public class NodeSelectorSlot extends AbstractLinkedProcessorSlot<Object> {
cacheMap.putAll(map);
cacheMap.put(context.getName(), node);
map = cacheMap;
// Build invocation tree
((DefaultNode) context.getLastNode()).addChild(node);
}
// Build invocation tree
((DefaultNode)context.getLastNode()).addChild(node);
}
}