mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[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:
+6
-7
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user