From 20b96564577e152a00dc295143cac360f146a09b Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Fri, 8 Jun 2018 05:48:31 +0300 Subject: [PATCH] [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. --- .../graph/collapsing/BranchFilterController.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/collapsing/BranchFilterController.java b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/collapsing/BranchFilterController.java index c45d60023d75..6311a96081b0 100644 --- a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/collapsing/BranchFilterController.java +++ b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/collapsing/BranchFilterController.java @@ -29,26 +29,25 @@ import java.util.Set; public class BranchFilterController extends CascadeController { @NotNull private CollapsedGraph myCollapsedGraph; - @Nullable private final Set myIdsOfVisibleBranches; + @NotNull private final UnsignedBitSet myVisibility; public BranchFilterController(@NotNull LinearGraphController delegateLinearGraphController, @NotNull PermanentGraphInfo permanentGraphInfo, @Nullable Set 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; }