Parcourir la source

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

master
Lin.Liang Eric Zhao il y a 5 ans
Parent
révision
ee38587a6e
1 fichiers modifiés avec 6 ajouts et 5 suppressions
  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 Voir le fichier

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

}
}



Chargement…
Annuler
Enregistrer