[vcs-log-graph] do not recalculate reachable nodes in branch filter controller after rebuilding delegate graph

Visibility is calculated for the whole permanent graph that does not change.
This commit is contained in:
Julia Beliaeva
2018-06-14 03:44:32 +03:00
parent ea52e844a6
commit 20b9656457
@@ -29,26 +29,25 @@ import java.util.Set;
public class BranchFilterController extends CascadeController {
@NotNull private CollapsedGraph myCollapsedGraph;
@Nullable private final Set<Integer> myIdsOfVisibleBranches;
@NotNull private final UnsignedBitSet myVisibility;
public BranchFilterController(@NotNull LinearGraphController delegateLinearGraphController,
@NotNull PermanentGraphInfo<?> permanentGraphInfo,
@Nullable Set<Integer> idsOfVisibleBranches) {
super(delegateLinearGraphController, permanentGraphInfo);
myIdsOfVisibleBranches = idsOfVisibleBranches;
myCollapsedGraph = updateCollapsedGraph();
myVisibility = ReachableNodes.getReachableNodes(myPermanentGraphInfo.getLinearGraph(), idsOfVisibleBranches);
myCollapsedGraph = update();
}
@NotNull
private CollapsedGraph updateCollapsedGraph() {
UnsignedBitSet initVisibility = ReachableNodes.getReachableNodes(myPermanentGraphInfo.getLinearGraph(), myIdsOfVisibleBranches);
return CollapsedGraph.newInstance(getDelegateController().getCompiledGraph(), initVisibility);
private CollapsedGraph update() {
return CollapsedGraph.newInstance(getDelegateController().getCompiledGraph(), myVisibility);
}
@NotNull
@Override
protected LinearGraphAnswer delegateGraphChanged(@NotNull LinearGraphAnswer delegateAnswer) {
if (delegateAnswer.getGraphChanges() != null) myCollapsedGraph = updateCollapsedGraph();
if (delegateAnswer.getGraphChanges() != null) myCollapsedGraph = update();
return delegateAnswer;
}