Преглед изворни кода

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

master
Lin.Liang Eric Zhao пре 5 година
родитељ
комит
ee38587a6e
1 измењених фајлова са 6 додато и 5 уклоњено
  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 Прегледај датотеку

@@ -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);

}
}



Loading…
Откажи
Сачувај